For EDI files which need to be archived, I would like to use a compression utility (like 7Zip) which collects and compresses files based on their file date. For example, a weekly archive (incoming-2009-01.7z for week 1) needs to be updated with all incoming files whose file date is in this week.
Is there a command line utility which can be used to invoke a compression tool with the necessary arguments, or an other easy way to implement such an archive strategy?
Best Answer
I don't know of a utility that provides this directly but it's fairly straightforward to build a script (using powershell, perl, python ..) to identify the files that meet your criteria, drop the fully qualified names (e.g. d:\incoming\something\filename.ext ) into a flat text file, one file name per line and then have your compression utility create an archive from that list file e.g.
If you wrap the whole thing inside the script then it's trivially easy to assign the type of archive names that you specified.
Added a Powershell example.
It's not quite a one liner, you will need to point it properly at the 7-Zip exe, add some parameter handling, some logging\error handling and it should clean up the working files but it's a pointer in the right direction.