View Single Post
Old 10-03-2013, 06:52 AM  
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
Code:
#!/bin/sh
# This is auto database remote backup script

#directly create gzip on the fly
mysqldump -u username -pPassword DB_name | gzip -v  > /home/backup/db_backup$(date +"%Y-%m-%d").sql.gz

#this will upload files to remote ftp server
#this is for 1st remote server
curl -u username1:password1 -T /home/backup/*.gz ftp://ftp.domain1.com/
#this is for 2nd remote server
curl -u username2:password2 -T /home/backup/*.gz ftp://ftp.domain2.com/
#this is for 3rd remote server
curl -u username3:password3 -T /home/backup/*.gz ftp://ftp.domain3.com/
#this is for 4th remote server
curl -u username4:password4 -T /home/backup/*.gz ftp://ftp.domain4.com/
#this is for 5th remote server
curl -u username5:password5 -T /home/backup/*.gz ftp://ftp.domain5.com/

#this will delete the dump file from local server.
rm -f /home/backup/*.gz

then create a daily cron to run this.

Last edited by freecartoonporn; 10-03-2013 at 06:54 AM..
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote