PDA

View Full Version : Linux server script and crontab entry



legacy-MrE
04-03-2004, 08:59 PM
I've got a great machine setup on a full T1 that is available weeknights after 6pm EST and all weekend. I'd like to setup a simple cron job to run the server from 6pm to 6am Mon-Fri and all weekend.

I have to believe someone else has already set this up, and I just would like a sample server startup script for cron to run at the desired times.

I just upgraded my old p3-800/512m ram to an xp2000/512m ram because the old server was running at 98+ % cpu and digging into swap. The new rig runs much better at around 80+ % cpu at full load (16 clients) and about 480m memory usage w/o touching swap.

I've run various game servers on several platforms over the years, and I can't say enough good things about SuSe linux. It does all that I need w/o requiring a ton of effort for the regular server admin stuff, is stable, and gives me an ncurses menu for server administration when I can't redirect the X display.

I've got the server running Onslaught, but also enjoy Assault, CTF, and the occasional Team DM and Double Domination game modes as well.

If you'd like to come frag on a good server, look for the following server name in your UT Broswer;

+ + + The M******* + + +

The server runs it's own firewall behind another firewall, so it doesn't respond to simple ping requests. But if you are in the Northeast US, you'll get a great ping to this server sitting on Verizon backbone connection.

192.156.204.114:7777

Hope to see you there!

MrE

legacy-d0ubl3_h3l1x
04-04-2004, 10:12 PM
I'd have two entries as separate scripts just to keep it clean:

0 18 * * 1-5 startscript
0 6 * * 1-5 stopscript

The first one runs "startscript" at 6pm on Monday. The next entry to hit time-wise is the second line, which will run at 6am throughout the week.

On Friday, you can see that it will start like any other script at 6pm but run until 6am Monday.

Then you'll need the two scripts. I would just have them something like this:

startscript:
#!/bin/bash
/directory_info_here/ucc-bin server ONS-Torlan?game=Onslaught.ONSOnslaughtGame -nohomedir

stopscript:
#!/bin/bash
killall ucc-bin

Don't forget to chmod each script to executable. Hope this helps ("man 5 crontab" is a good resource).

-Helix

legacy-PsychoChihuahua
04-04-2004, 11:32 PM
What he said. :)