Jump to content

Best way to do backup's?


Smir

Recommended Posts

What's the best way to do backups?

 

We have an external storage server we can use for backup's but what is the best way to set it up?

 

I see away to run a scheduled task to do it, but the "features" of this product;

Backup and restore tool - We all know that hard drives fail. When they do, you can get all the game servers running again within minutes. With the TCAdmin backup tool you can create backups of your database and game servers. Run the backup as a scheduled task and you will always be prepared for the worst.

 

where is such a tool?

 

Ideally, we want a weeks worth of backups... and it over rights them

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

as it goes to day 8, it removes day 1 and over rights the information, etc etc

Link to comment
Share on other sites

You can setup backups under System>Settings>Recurring Tasks in Version 2.

 

The DB backup script is already in there. You can create a script to back files easily if you wanted.

I suppose you have a script available for us to use since its easily done?..

 

shame it isn't built in like the features suggest.

Link to comment
Share on other sites

This can be done really, really, really easy using a bash script. We use this to create remote backups from all TCAdmin servers to our backup server.

How it works:

Our backup script is being run as a cron job from our backup server. The backup server is told to connect to our TCAdmin server, find all folders that starts with tcagame* and download them into a folder on the backup server that includes the server name and the date and time of the backup. Once the backup has finished, the script sends us an email. It removes old backups as well.

 

This exact script has been created to take backups from a server that has an a record called "game001.primaservers.com". Change the name and domain to fit your needs.

 

#!/bin/sh
function sendMail {
TOMAILAA=$1"@primaservers.com"
TIME=$( date +%d.%m.%Y-%H.%M.%S )
SUBJECT="Server backup | Game001"
echo "Backup of $SERVER has been completed." | mail -s "$SUBJECT" $TOMAILAA
}

function dl {
TIME=$( date +%d.%m.%Y-%H.%M )
SERVER=$1
REMOTEDIR="/home/tcag*"
SAVEDIR="/home/backup/"
DOMAIN="primaservers.com"

 cd $SAVEDIR
 mkdir $SERVER"."$TIME
 scp -oStrictHostKeyChecking=no -P 22 -r $SERVER"."$DOMAIN":"$REMOTEDIR $SERVER"."$TIME
  echo "("$SERVER") Download was successful!"
}

dl game001

find /home/backup/* -mtime +2 -exec rm -r {} \;

sendMail support

#END

Edited by DennisMidjord
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Who's Online   0 Members, 0 Anonymous, 25 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use