SRCDS Steam group


Scheduled tasks question
#1
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?
Reply
#2
You can write a bat script and make scheduled tasks run it.
I would recommend moving the zipped logs to a different folder to make it easier.
You will need to download a command line program to zip the data because windows doesn't have one built in. Sad
~ Mooga ...w00t? - SRCDS.com on Twitter
[Image: 76561197965445574.png]
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.
Reply
#3
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
Reply
#4
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
[Image: 76561197965445574.png]
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.
Reply
#5
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
Reply
#6
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!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)