Categories
PHP

Automated MySQL Database Backup System

I just finished writing a tool to automate mysql database backup. It dumps the configured mysql database, zips the SQL file into a TGZ archive and emails the attachment to a predefined email address.

Download: http://masnun.googlecode.com/files/sqlbackup.zip

What you need to do to use this tool is to download it, extract the folder named “sqlbackup”, edit the index.php file to configure the database and email settings, upload the folder to your webhost and set up a cron job to run the tool periodically.

In fact, it’s simple though it looks complicated. Try it yourself! Gonna be easy.

I am using Yahoo! Mail and a custom filter to store the database backups into a dedicated folder inside my Yahoo! Mailbox. Yahoo! has un-metered storage. So you can use this huge storage to have your databases backed up safely.

I am running the cron job once everyhour for testing purpose. I will set it to run once a day since I don’t have much database operations everyday. If your application sees frequent database changes, use a frequent cron job. Please consider checking out your control panel to know how to set a cron job if you don’t know already.

Enjoy!

One reply on “Automated MySQL Database Backup System”

Comments are closed.