I am trying to create a script that need to archive text logs from last week.
Basically we have a path where we have folders on date as follows, Each folder contains csv files containing data for that day
2015-02-01
2015-02-02
2015-02-03
2015-02-04
2015-02-05
We want to run a script that runs every sunday and archives all folders and files with in an archive for all the folders last week.
Any idea how I can achieve that?
I am using this command as a test which should archive all folders older then 5 days but its just compressing one folder
find . -type d -mtime +5 -print -exec tar -zvcf test.tar.gz {} \;