I made a simple script to backup my word press every day at 12:30, if you want to make it by hand look at Backup WordPress.
script
1 2 3 4 5 6 7 8 |
#mysqldump mysqldump --databases --opt -Q -uroot -pPASSWORD wordpress | gzip > database.gz #create archive tar -cvpzf "/Backup/"`date +%d-%m-%Y`".tar.gz" ./database.gz /var/www/ #copy to backupserver sshpass -pPASSWORD scp "/Backup/"`date +%d-%m-%Y`".tar.gz" root@server.local:/volume1/DATA/BACKUP #delete rm "/Backup/"`date +%d-%m-%Y`".tar.gz" |
Install
save this script at your server, I choose “/root”, then run this:
1 2 3 |
mkdir /Backup; chmod +x /root/backup.sh; apt-get install sshpass; |
now we add this to the cronjob:
1 |
crontab -e |
and add this line:
1 |
10 8 * * * /root/backup.sh |
then wait and test if your server shows the backup files.
Hello there, You’ve done a great job. I will certainly digg it and personally suggest to
my friends. I am confident they’ll be benefited from this web site.
Hi there, just wanted to say, I enjoyed this article.
It was helpful. Keep on posting!
If some one needs to be updated with hottest technologies afterward he must be
go to see this web page and be up to date everyday.
Incredible! This blog looks just like my old one! It’s on a entirely different subject but it has pretty much the same layout
and design. Great choice of colors!