Link to home
Create AccountLog in
Avatar of JWeb Admin
JWeb Admin

asked on

Using a pre-written script

I'm using a pre-written script which can be found here: http://winadmin.forret.com/scripts/warmzip/

I want to combine a few commands together in order to compress log files that are older than 1 days (compress all log files in the log directory which I've set which is typically d:\)

I want to both compress the log files, AND move them to a network share: \\backupserver\logs\machinename

Using the above website and the above script, what would my batch file look like?  Do I simply combine the command lines to just one line, or do I create 2 seperate batch files, one that compresses the logs, and another that moves them?

I wasn't sure if I could combine the commands into just one line, one step.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of JWeb Admin
JWeb Admin

ASKER

OK - so should I create 2 seperate batch files?  I can schedule them as a scheduled task to run one after another maybe with a 30 minute delay just to give it time to zip the files up.  

What do you recommend?
If my method is acceptable, you won't need two batch files.

If you go along with RobSampson's solution, I expect putting in a single batch file will work. Batch commands are executed sequentially unless you explicitly launch asynchronously. This means the second command won't run until the first is complete.
Thejaka is right, if you're using my approach, this would be your batch file:

@echo off
waRmZip.wsf /r /f:.log "D:\" /ca:1 /cp:"c:\Program Files\7-Zip\7za.exe" /cpp:"a -tzip $out $in"
move D:\*.zip \\server\share\

Regards,

Rob.