[cod] Cron.jobs/Auto Restart

[KaoS] Stryker ohnueaglehawk at comcast.net
Wed Feb 11 14:43:56 EST 2004


MessageHere I s what "ArdChoille" wrote: But my question is where do these files go? In what directories? Thanks for the help.


  Start server

  Call this start and make it executable


code:----------------------------------------------------------------------------#!/bin/sh

start=`date '+%H:%M on %d/%m/%y'`
echo "CoD server started @ $start" >>/usr/local/games/CoD.log
screen -A -m -d -S CoD ./cod_lnxded +set sv_cheats 0 +map_rotate +set fs_homepath /usr/local/games/callofduty +set fs_basepath /usr/local/games/callofduty +exec codserver.cfg >/dev/null 2>&1 &
echo $! >CoD.pid----------------------------------------------------------------------------

  Cron script
  This checks to see if the server is running and restart it if its not

code:----------------------------------------------------------------------------#!/bin/sh

gamedir=/usr/local/games/callofduty
pidfile=CoD.pid

cd $gamedir
if [ -f $pidfile ]; then
	kill -0 `cat $pidfile` >/dev/null 2>&1
	if [ $? -ne 0 ]; then
		./start >/dev/null 2>&1
	fi
else
	./start >/dev/null 2>&1
fi----------------------------------------------------------------------------

  Cron job

code:----------------------------------------------------------------------------*/5 * * * * /usr/local/games/callofduty/cron----------------------------------------------------------------------------
  This will make the script above run every 5 minutes 

  screen -A -m -d -S CoD will open a screen and run the server in it, this screen will be detached and called CoD
  You can bring up the server console by using screen -r CoD - to detach again ctrl +a d.


code:----------------------------------------------------------------------------start=`date '+%H:%M on %d/%m/%y'`
echo "CoD server started @ $start" >>/usr/local/games/CoD.log----------------------------------------------------------------------------
  This makes a file called CoD.log and inputs the time the server was started 
  [KaoS] Stryker CL

  'Strike First Strike Hard"


   
    ----- Original Message ----- 
    From: plebs 
    To: cod at icculus.org 
    Sent: Wednesday, February 11, 2004 9:23 AM
    Subject: RE: [cod] Cron.jobs/Auto Restart



    A good thread for this is http://www.fpscentral.com/forums/showthread.php?s=&threadid=8907 . It worked for me.


      -----Original Message-----
      From: [KaoS] Stryker [mailto:ohnueaglehawk at comcast.net]
      Sent: 11 February 2004 15:58
      To: cod at icculus.org
      Subject: [cod] Cron.jobs/Auto Restart


        I am not the computer savvy one but I am helping an associate out getting the info. We want to set up a server auto restart. This is new to me so forgive me if I sound confusing. But I believe we want to set up cron.job to check server approx every few minutes  to see if it is running or timed out and then execute the startup process if its down. I understand we need several elements to make this work. Cron.job, cron.script and crontab or something like that. Could someone help us out on getting this setup. We need to know what folders these files/scripts are suppose to reside in and how to get it to run..........Cron.jobs for idiots.
        Ha-ha, I would appreciate the help Guys, Gals.


        Stryker 




         

----------------------------------------------------------------------


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/cod/attachments/20040211/65849991/attachment.htm>


More information about the Cod mailing list