I just wrote a simple bat file to restart the server every 10 hours.
Code:
@echo off
cls
title CSS Restarter
echo This program restarts the server every 10 hours.
:start
echo Restarting the CSS server in 10 hours.
wait 36000
pskill srcds.exe
echo Restarted.
goto start
If you have xp home, you have to download wait and put it into your windows/system32 folder. Also, pskill has to be placed in system32.
*****www.microsoft.com/technet/sysinternals/utilities/pskill.mspx
You can also use taskkill, but I have xp home on my server so it was not included. You can change the wait to whatever time you want. It is in seconds.
It works only when you are also running the restart batch file.
Code:
@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) srcds started.
start /wait srcds.exe -console -game cstrike +map de_dust +maxplayers 16
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds
You could combine them and just add the start line right after the kill line but the server would not restart if it crashed. It would look like this:
Code:
@echo off
cls
title CSS Restarter
echo This program restarts the server every 10 hours.
:start
echo Restarting the CSS server in 10 hours.
wait 36000
pskill srcds.exe
start srcds.exe -console -game cstrike +map de_dust +maxplayers 16
echo Restarted.
goto start