Sun Solaris Script for finding files in specific date range and zipping them
$10-30 USD
Completed
Posted about 10 years ago
$10-30 USD
Paid on delivery
I have a Sun Solaris system. I am looking for a basic shell script(KSH) that can parse the sub directories under a direcory SAY:~/MasterDirectory.
~/MasterDirectory has subdirectories: FOLDER1, FOLDER2, FOLDER3 etc....These subdirectories has files in it.
The script should parse each subdirectory and perform the following:
1) Go to one sub directories then find files from 2012-01-01 and three months prior from today's date and start zipping them month by month.
That is: if the script runs on 01-20-2014 it should pick up files from 01-01-2012 through >3 months prior 2013-09-30. So select files between 01-01-2012 and 2013-09-30 if the script is run in January.
2) Only Zip the files found in the above list MONTH BY MONTH and name the zip file titled: 'archive_%SubDirectoryName%[login to view URL]'. So for each month there will be one zip file.
3) Copy the zip files from ~/MasterDirectory/Subdirectory to /home/archive directory with the original timestamp and delete the files from the original subdirectory.
Once the above step is complete for a given subdirectory....move to the next subdirectory and repeat the same step above. I have SUNOS and have ksh available.
Thanks