( search forums )
Crontab to keep your server alive 24/7
Soldat Forums - Soldat Talk - Server Help
escapedturkey
September 11, 2003, 3:52 am
Here's how I use crontab to keep a server alive 24/7.

This will check to see if the process is alive, every 10 minutes, if it doesn't see the server/process, it restarts the server/process.

This is just for Solidat but I also have it for my Quake 3 server.

You can figure out what I do just by the examples I give - or reply if you have more questions.

Start Command

crontab start.cron <-- starts file for crontab entries.

Other Commands

crontab -l <-- to list crontab entries.

crontab -r <-- to empty crontab entries

Contents Of Files

start.cron

*/10 * * * * /home/escapedturkey/startup/soldatchk >/dev/null 2>&1

soldatchk

#!/bin/sh

soldatdir="/home/escapedturkey/soldat/server"
process=`ps auxw | grep soldatserver | grep -v grep | awk '{print $11}'`

if [ -z "$process" ]; then

cd "$soldatdir"

/home/escapedturkey/soldat/server/soldatserver soldatsplenda

fi

Tweak896
September 14, 2003, 8:09 am
but what does that do?

pyth
September 14, 2003, 6:45 pm
"Crontab to keep your server alive 24/7" that means. keeps your server alive 24/7. if it crashes it will be loaded up again.