Automated wordpress backup

From many different choices for wordpress backup, I picked this one. I have made some minor changes, original script was reporting some silly warnings regarding tar params. You can download altered script here: dbBackUp.txt.
I like this particular php script because it sends me email with compressed wordpress database in attachment whenever it is executed. It can be called manually from web browser, if you place it in public directory on your website server. Or, as I'm using it, you can use cron daemon to activate script. I have created little bash script and placed it under folder: /etc/cron.daily/ Bash script is trivial:

#!/bin/sh
/usr/bin/php /srv/mysitefolder/dbBackUp.php
exit 0

Every morning I get fresh email with compressed database backup file. To make my life easier, I have created separate gmail account whose sole purpose is to receive "backup emails".
Only draw back that I see is that you must have at least one writable folder, in case you are calling script via web browser on shared hosting, or ssh access to server to schedule cron job for auto backup.
Oh, and one more thing, it requires that you have installed PEAR - PHP Extension on your server.
One thing that can be improved is compressing and emailing images and wordpress content directory along with database dump.
So remember, backup early and backup often, don't learn it the hard way!

This entry was posted in Web and tagged , . Bookmark the permalink.

Leave a reply