WordPress Backup Script

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.


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
rm "/Backup/"`date +%d-%m-%Y`".tar.gz"



save this script at your server, I choose “/root”, then run this:

mkdir /Backup;
chmod +x /root/backup.sh;
apt-get install sshpass;

now we add this to the cronjob:

crontab -e

and add this line:

 10  8 * * * /root/backup.sh

then wait and test if your server shows the backup files.

4 thoughts on “WordPress Backup Script”

  1. 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.

  2. 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.

  3. 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!

Leave a Reply

Your email address will not be published.

five − 4 =