Need a script to archive log files
Posted on 2011-09-14
I hope someone can help. I have had a few stabs at this but it doesn't seem to be working.
I need help writing a script that will zip up the previous month's worth of logfiles, move the zip to a network folder on a mapped drive and then delete the original logs.
The compression format isn't too important, as long as it's fast and gets reasonably good compresion ratios with text/html files, which should be all. I've been favouring 7zip.
The script language isn't too important either as long as it can be run completely in the background as a Windows 7 scheduled task and not impact performance. This rules out linux shell scripting.
An example of the format for todays logs would be:
Webs - Daily - 14 - 09 - 11.txt
Webs - Daily - 14 - 09 - 11.html
Also, there is usually only one file per day, html or text.
If anyone can help I'd be very grateful.