How To Back Up Your Server

If you are an affiliate, you should already know the importance of backing up your local and server files.

Here’s a message I got from a friend:

[14:05] my laptop bit the s***
[14:05] so I’m about to replace the harddrive
[14:05] and I have no data backup

Here’s how I backup my server files:

First, ssh in to your server. I like to use Putty.

Next, type:

tar -cvf TodaysDate.tar ~/domains/*

(Assuming your ~/domains/* is the directory of your domains. If you are unsure, navigate to your domains directory and type ‘pwd’)

Then I use Core FTP Light to download the file every Friday.

I also use this MySQL Backup Script to easily back up all my SQL databases. This is much easier than dumping the SQL databases, or going through extensive commands to back up each database individually. Here’s the instructions on how to install the script.

If you want to automatically back up your SQL databases, then type crontab -e and add a new line. Here is an example:

30 0 * * * php /root/scripts/backup_dbs.php

That will configure cron to run the script every day at 12:30 am.

Leave a Reply