Posts: 46
Threads: 11
Joined: Dec 2007
Reputation:
0
Hey guys, was wondering if you could help me...
I'm looking for some software that would enable me to do the following on my servers:
Once a week, delete the contents of the 'downloads' folder for each server and create a zip/rar of the logs in the 'logs' folder. Once the logs are archived I would then like the .log files to be deleted as well.
Is this possible? Scheduled Tasks doesn't seem to be this advanced...
Any suggestions?
Posts: 46
Threads: 11
Joined: Dec 2007
Reputation:
0
Thanks for that...has anyone got a link to a good guide on how to write bat scripts? I have update scripts for my servers, but they were'nt difficult to create. This looks a little more involved
Posts: 3,906
Threads: 404
Joined: Oct 2007
Reputation:
21
Here's a breakdown on how to write it.
If I have some time I might give it a try, but don't expect it soon.
- Delete Download dir
- Move to Log dir
- Zip logs at the DATE.zip
- Move Zips to logs/zips
- Delete Logs dir
~ Mooga ...w00t? -
SRCDS.com on Twitter
Please do not PM me for server related help
fqdn Wrote:if you've seen the any of the matrix movies, a game server is not all that different. it runs a version of the game that handles the entire world for each client connected. that's the 2 sentence explanation.
Posts: 46
Threads: 11
Joined: Dec 2007
Reputation:
0
Ok, I did some digging and came up with this:
COPY F:\gameservers\dm1\hl2mp\logs\*.log F:\gameservers\#logs\dm1
DEL F:\gameservers\dm1\hl2mp\logs\*.log
I figured keep it simple, so I didn't bother with the zip/rar bit. This seems to work fine for my needs, but if anyone could show me how to copy to a new subfolder named by date I'd really appreciate it
Posts: 46
Threads: 11
Joined: Dec 2007
Reputation:
0
Sussed it, hopefully it might be of use to someone else:
cls
@ECHO OFF
SET YEAR=%date:~-4,4%
SET MONTH=%date:~-7,2%
SET DAY=%date:~0,2%
MD F:\backups\gameservers\dm1\#logs\%YEAR%-%MONTH%-%DAY%
COPY F:\gameservers\dm1\hl2mp\logs\*.log F:\backups\gameservers\dm1\#logs\%YEAR%-%MONTH%-%DAY%
Now off to set up some scheduled tasks and write a batch file for automated server backups. Yay!