
Before installing pretty much any of these, you probably want to set crontab to email you. You can do this by running "crontab -e" and adding this line to the top of the file
MAILTO="your@address.com"
Backup MySQL
This script takes incremental backups of MySQL.
Features:
- Saves backups by date
Backup as often as you want
Automatically finds all your databases
Backs up each table individually for minimal table locking time and small easy to work with backups
Compresses the backups so they use minimal space
Uses low priority cpu and io scheduling so that backups operations shouldn't slow down your server
1) Run these commands:
- git clone git://github.com/Azelphur/backup_mysql.git
cd backup_mysql
nano backup_mysql.sh
3) Run the script manually to ensure everything is working by typing "./backup_mysql.sh" it should tell you about which backups it's performing, and then tell you that the backup is complete.
3) Add the script to your crontab to have it automatically run daily, type "crontab -e" and add "00 00 * * * /path/to/backup_mysql.sh" at the bottom.
srcds-detect-freeze
This script will detect if srcds (So CS:S, TF2, L4D(2), etc) has frozen by sending it A2S_INFO queries and restart it automatically if it is not responding.
Features:
- Supports multiple game servers
Custom start and stop commands per server
Ability to use TwistedCat to let you know when a server has frozen.
Runs from a cron job, so totally custom server check intervals
1) Run these commands:
- git clone git://github.com/Azelphur/srcds-detect-freeze.git
cd srcds-detect-freeze
git clone git://github.com/frostschutz/SourceLib.git
nano srcds-detect-freeze.py
3) Add the script to your crontab to have it automatically run every 5 minutes, type "crontab -e" and add "*/5 * * * * python /path/to/srcds-detect-freeze.py" at the bottom.
TwistedCat
TwistedCat allows you to easily send notifications to IRC and/or XMPP (Google talk, Android phones) via netcat. This works really well with nemrun, as you can get a notification to your phone when your server is updating. It also works in combination with srcds-detect-freeze to notify you when a server is frozen or SourceMod is broken.
You can get it from https://github.com/Azelphur/TwistedCat there are instructions in the readme at the bottom.
To make nemrun notify you when an update is available, run the updater daemon with something like -notifycmd "echo Server is downloading an update | twistedcat"
Rate limit a webserver
Although this isn't usually an issue, If you host sv_downloadurl or mirror large files on the same server as your game servers you may want to rate limit it so that if a client with a very fast internet connection downloads large files from your webserver, it doesn't lag the game servers. Here is a snippet that will rate limit port 80 to 500mbit/sec.
Code: Select all
dev="eth1"
tc -s qdisc del dev $dev root
iptables -t mangle -v -D OUTPUT 1
tc qdisc add dev $dev root handle 1: htb
tc class add dev $dev parent 1:1 classid 1:5 htb rate 500mbit ceil 500mbit prio 1
tc filter add dev $dev parent 1:0 prio 1 protocol ip handle 5 fw flowid 1:5
iptables -A OUTPUT -t mangle -p tcp --sport 80 -j MARK --set-mark 5
