Hello Team,
We would like to backup a lot of files inside of a structure of directories, four, five or more levels in some Ubuntu, Mac and Solaris systems.
For instance:
/home/chuck/sales/virgin/rent-quote.pdf
/home/chuck/sales/marriott/vacation-quote.pdf
/home/chuck/sales/telefonica/mobile-quote.pdf
I would like to create a shell script in order to archive the files in other filesystem with the following conditions:
- Conserve the same original directory structure
- Classify by year in a new directory (last date of modified)
- Move the file to the new archive directory
output:
/backup/home/chuck/sales/2010/virgin/rent-quote.pdf
/backup/home/chuck/sales/2011/marriott/vacation-quote.pdf
/backup/home/chuck/sales/2012/telefonica/mobile-quote.pdf
In the future I would like to run this script periodically to archive files with more than 60 days old
I really appreciate it your help
Regards,
Carlos