How can I use 7zip and the command line to select certain files by Date modified and automate by using a batch file?
Ok. I used Robocopy to set aside the data that was a certain age or older, then used 7za to compress and removed the temp files. See below:
I'm dealing with two sets of log files here, one an onsite backup and one an offsite Disaster Recovery (DR) backup.
Robocopy is available in the Windows Resource Kit (Here's the Server 2003 version) and has some pretty cool features. The one I use here is the /minage argument, which I've used to specify that log files over 60 days old are to be moved (not copied) to appropriate folders inside a Spool directory. I then compress the contents of the Spool directory to a third location, then finally delete the Spool directory.
On Linux systems, the following command should compress the files contained in
But it will not preserve the directory structure. A similar command creating a tar archive first and then compressing it using