MV files from one directory structure(multiple level) to other directory structure

Hi,

I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in destination that are older than 5days. Please do let me know ASAP if you have any solution. Thanks in advance.

srmadab

To copy a directory structure checkthis thread.

To find and move files older than specific date, check this thread and modify the script as per your needs.

Thanks very much for the help. Aslo I was asking for deleting from the hirarchy structure if it is more than 5 days old.

srmadab

I don't know what you are trying to do, I think you want something like this:

find /path -type d -mtime +5 -print | xargs rm -r

But be careful with above command.

Thanks very much. This helped a lot.

srmadab