how to do selected copy

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.......... :confused:

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? :cool:

look at -exec option of find

find /source_dir/ Fexp*.* -mtime -3 -exec cp {} /target_dir \;

Thanks sssow!

This also works good: :cool:

find /global/Oracle/BACKUP/fsdev/EXP/Fexp.log -mtime -3 | xargs -I {} cp {} /global/Oracle/BACKUP/fsdev/