Automatically Send MySQL Database Backup To Gmail - gHacks Tech News

Automatically Send MySQL Database Backup To Gmail

Webmasters have to make sure that their websites and files are getting backed up regularly to be prepared when something unforeseen happens. This unforeseen event can be a hacker attack, a database crash, a fire in the data center of the hoster or human error. Whatever the cause is it can have a severe impact on the service and business if backups are not available to restore the website or service.

Many web hosting companies offer backup space and create backups regularly. Some on the other hand ask for additional payments or do not offer this backup service at all. It then is up to the webmaster or server administrator to ensure that the data gets backed up regularly so that it can be restored when needed.

One option that is becoming increasingly popular is to backup data and send it to an offsite storage space. Backup2Mail is such a script. It can initiate automatic MySQL database backups on Linux servers using cron jobs and transfer these backups to a Gmail account. The only restriction is that the size of the zipped database should not exceed the maximum attachment limit of Gmail which is currently 25 Megabytes.

The developer provides instructions on how to setup the MySQL database backup and Gmail transfer on his website. It basically means that the user needs to edit an index.php file to provide the script with the MySQL information and GMail data. The only thing left after this step is to create a cron job so that the script is executed regularly on the server. Backups will from then on be created automatically on the web server and send to the Gmail account.

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. Rarst said on July 13, 2009 at 6:20 pm
    Reply

    For WordPress there is decent WordPress Database Backup plugin, easier than setting up cron job. :)

    It works fine except that it once froze and stopped sending backups on WP update (good idea to check all plugins after such).

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.