Killer Creation - A Network Designed for Your Needs




Login





KillerCreation Forums: Cron Script to auto update my L4D2 servers - KillerCreation Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cron Script to auto update my L4D2 servers Linux Scipt

#1 User is offline   IXL 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 87
  • Joined: 11-May 10
  • Gender:Male
  • Location:Hertfordshire
  • Interests:All. Life can be intersting in itself.

Posted 31 July 2010 - 09:01 AM

Hi Fellas,

I was wondering if anyone can help me out here at all ? I would be very grateful.

As you may already be aware, Left for Dead 2 for example, like many steam games (server side in particular ) has been having a huge amount of updates this last few weeks and its driving me crazy, finding out too late and having to do it manually.
Ive not done cron jobs before but basically I want to stop a screen session of a gameserver, update it and restart the gameserver at say 4am in the morning. ( I do rent an entire linux centos server from you, so root access should be no problem if yoru wondering. )

To give you my basic layout, I use webmin's custom commands to execute three main scripts atm. These scripts are all saved separetely away from the users ( gameserver ) home directory.

Quote

IE
/home/scripts/server1 ( server 1's scripts )
/home/server1/ ( left4dead server )


The scripts are basic start, stop and update. Each script looks a bit like this :

Start:

#!/bin/sh
cd /home/server1/left4dead2
screen -r -X quit
screen -wipe
echo Server has been rebooted 
screen -dmS server1 ./srcds_run -game left4dead2 +maxplayers 8 +IP XX.xx.XXX.xx -port 27315


Update ( im not bothering with stop, you get the idea)

#!/bin/sh
cd /home/server1/
screen -r -X quit
echo Server has been stopped
echo Ready for update please wait
./steam -update "left4dead2" /home/server1


Now Im just a bit confused with how I add a timed update to this to run every morning? Do I have to create a separate script, or can I include it in the start script somewhere...? Im led to believe I should add in crontab -e to my scipt and then something like 02 09 * * * before my update line.

Appologies for my poor linux understanding, but ive never done scripts like this before and want to make sure im doing it right.

Also, if this is possible, is there some way to log the output to somewhere in the /home/server1 folder, so I know it has been updated ?


Can anyone help?

This post has been edited by IXL: 31 July 2010 - 09:07 AM

Xfire = xlansixl
Steam = http://steamcommunity.com/id/ixl
TGUK STEAM GROUP = http://steamcommunity.com/groups/tguk
TGUK TWITTER PAGE = http://twitter.com/#TeamgamersUK
BC2 = I.X.L
ORIGIN = I-X-L
0

#2 User is offline   KC-Justin 

  • KC Staff
  • PipPipPipPip
  • Group: Administrators
  • Posts: 1,455
  • Joined: 01-January 07
  • Gender:Male

Posted 04 August 2010 - 02:20 PM

Replied via support ticket.
Justin Anstes
KillerCreation Networks Ltd
http://www.KillerCreation.co.uk
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users