Welcome to It-Slav.Net blog
Peter Andersson

I've already got a female to worry about. Her name is the Enterprise.
-- Kirk, "The Corbomite Maneuver", stardate 1514.0

Now when my blog is growing a need for backup is growing. After a short google search I found exactly what I want, automysqlbackup.

It is a shell script that has very modest requirements list:

  • mysqldump, included in mysql client
  • gzip or bzip2 if you want it compressed.
  • mail if you want the status of the script to be emailed.


  • Backup mutiple MySQL databases with one script. (Now able to backup ALL databases on a server easily. no longer need to specify each database seperately)
  • Backup all databases to a single backup file or to a seperate directory and file for each database.
  • Automatically compress the backup files to save disk space using either gzip or bzip2 compression.
  • Can backup remote MySQL servers to a central server.
  • Runs automatically using cron or can be run manually.
  • Can e-mail the backup log to any specified e-mail address instead of “root”. (Great for hosted websites and databases).
  • Can email the compressed database backup files to the specified email address.
  • Can specify maximun size backup to email.
  • Can be set to run PRE and POST backup commands.
  • Choose which day of the week to run weekly backups.

Download it, modify some parameters and put in /etc/cron.daily and now your database is backuped.


One Response to “MySQL database backup automysqlbackup”

  1. Monitor MySQL backup automysqlbackup with op5 Monitor or Nagios | An It-Slave in the digital saltmine Says:

    […] have hinted about automysqlbackup in an earlier blog. Of course an important script like this should be monitored by Nagios or op5 Monitor. In my […]

Leave a Reply

2 × five =

Filled Under: bash, Hints, sysadmin

Book reviews
FreePBX 2.5
Powerful Telephony Solutions

Asterisk 1.6
Build a feature rich telephony system with Asterisk

Learning NAGIOS 3.0

Cacti 0.8 Network Monitoring,
Monitor your network with ease!