I need to copy the files from one dir to another dir based on sysdate, like
cp -> (sysdate-n) filename -> to -> new dir
n = 1,2,3..............
I need to copy the files from one dir to another dir based on sysdate, like
cp -> (sysdate-n) filename -> to -> new dir
n = 1,2,3..............
For the last 3 days no reply to my thread..........
I could do a selection and how to proceed to go for execution of the command in one line.
find /global/Oracle/BACKUP/fsdev/EXP/ Fexp*.* -mtime -3 ## this would get me files three days old.
can any one improve/alter/better this code?
look at -exec option of find
find /source_dir/ Fexp*.* -mtime -3 -exec cp {} /target_dir \;
Thanks sssow!
This also works good:
find /global/Oracle/BACKUP/fsdev/EXP/Fexp.log -mtime -3 | xargs -I {} cp {} /global/Oracle/BACKUP/fsdev/