I have two folders, for arguments sake /Volumes/A and /Volumes/B. They are mounted network shares from a Windows server containing a load of .bkf files from Backup Exec.
I am looking for a script which will look into both folders and find the most recently modified .bkf file and copy it to another location. There are other files in the folders which must be ignored.
Thanks in advance!!
Shaun
Edit:
I knocked this together:
cp ls -alt /Volumes/E /Volumes/F| grep bkf | head -n 1 | awk '{print $8}' /Volumes/$xservedisk/Windows/
Can anyone think of any reasons why I shouldnt use it?
Thanks again Shaun
I prefer this for finding the most recently modified file:
find . -type f -printf '%TY-%Tm-%Td %TT %p\n' | sort
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With