David Megnin
asked on
VBScript or Batch file to compress log files and move to another drive
I need a VBScript or Batch file to zip all the .log files in the various subfolders of %windows%\System32\LogFile s that are, say 14 days or older and move them to a different drive:\folder.
I found this thing http://winadmin.forret.com/scripts/warmzip/
It's suppose to allow you to script compressing and moving files. It looks very promising, but I got an error when I ran one of the sample batch files.
Thanks in advance.
I found this thing http://winadmin.forret.com/scripts/warmzip/
It's suppose to allow you to script compressing and moving files. It looks very promising, but I got an error when I ran one of the sample batch files.
Thanks in advance.
WHy not just use WinZip with the commandline version, and do it all with one neat little command? Something like this should do the job:
wzzip -m -Td14 "d:\destfolder\destfile.zi p" "%windows%\System32\LogFil es"
~bp
wzzip -m -Td14 "d:\destfolder\destfile.zi
~bp
ASKER
I guess that woud be the simplest way to do it. There is really no good reason to do each folder separately. I've never used the commandline version of WinZip. If it will grab just the *.log files that are >14 days old from all the sub folders then that will work a charm.
Can you have it delete the source files after zipping them? It doesn't help if they are left lying around. I need to do this to free up hard drive space on a db server.
Can you have it delete the source files after zipping them? It doesn't help if they are left lying around. I need to do this to free up hard drive space on a db server.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much! Now we can free up enough space on the system drive of our SQL Server to do an upgrade.
You just saved my company $15,000.00 by not having to buy a new server. ;-)
You just saved my company $15,000.00 by not having to buy a new server. ;-)
Excellent, glad I suggested that, and glad it worked out. Thanks for the grade, when can I expect my cut of the savings... :-)
~bp
~bp
ASKER
Post your bank account number and routing number here and I'll have it wired. ;-)
ASKER
Open in new window