Post Reply 
Automatic Offsite MySQL backup
04-19-2010, 11:39 PM (This post was last modified: 04-20-2010 12:59 AM by dmmcintyre3.)
Post: #1
Automatic Offsite MySQL backup
Step 1: SSH into the server you will be running the backups to. (not the computer with the databases on it)

Step 2: Create the backup directory
Code:
mkdir /mysqlbackups
cd /mysqlbackups

Step 3: Download the backup script. Go to http://sourceforge.net/projects/automysqlbackup/ and download it but copying the download link instead of downloading it to your computer.
Code:
wget {download link}

Step 4: Configure the script you just downloaded (if it is not version 2.5 change the number on the end, or if you renamed it use the new name.)
Code:
nano automysqlbackup.sh.2.5
Find the database user line and replace dbuser with your username for mysql.
Replace on the database password line dbpass with the database password.
Replace "DB1 DB2 DB3" on the dbnames line with "all"

Step 5:Set a cron job to run it
Code:
nano /etc/crontab
Use this as a guide: http://adminschoice.com/crontab-quick-reference

KVM2 (VPS 15, 19 and 25) Munin report | Check your VPS 15, 19 or 25's IOPS usage
User Tools
Quote this message in a reply


04-20-2010, 12:47 AM
Post: #2
RE: Automatic Offsite MySQL backup
Thanks for this nice tutorial.

Now i can save my valuable data from mysql databases. It will sure make of sleep in the night. Tongue

Largest growing Free cPanel Web hosting with unlimited features: powered by ExaByes
PerfectZ Forum
User Tools
Quote this message in a reply
04-20-2010, 10:49 AM (This post was last modified: 04-20-2010 11:08 PM by dmmcintyre3.)
Post: #3
RE: Automatic Offsite MySQL backup
I had a dead ram slot on the server I was running the backups to so I had to replace the hardware. Luckily I had a spare pc around that I just swapped the HD's to.

KVM2 (VPS 15, 19 and 25) Munin report | Check your VPS 15, 19 or 25's IOPS usage
User Tools
Quote this message in a reply
04-21-2010, 02:11 AM
Post: #4
RE: Automatic Offsite MySQL backup
You're lucky person bro. If your server died on that day, you will lose everything Tongue

Largest growing Free cPanel Web hosting with unlimited features: powered by ExaByes
PerfectZ Forum
User Tools
Quote this message in a reply
04-21-2010, 02:34 AM (This post was last modified: 04-21-2010 02:35 AM by dmmcintyre3.)
Post: #5
RE: Automatic Offsite MySQL backup
(04-21-2010 02:11 AM)eSupun Wrote:  You're lucky person bro. If your server died on that day, you will lose everything Tongue

The ram slot was dead the whole time I was using that server to back everything up. 128 MB RAM just was not enough

KVM2 (VPS 15, 19 and 25) Munin report | Check your VPS 15, 19 or 25's IOPS usage
User Tools
Quote this message in a reply
04-26-2010, 05:15 AM
Post: #6
RE: Automatic Offsite MySQL backup
thx for this info
User Tools
Quote this message in a reply
Post Reply 


Forum Jump:



User(s) browsing this thread:
1 Guest(s)