AutoMySQLBackup: Regularly Backup Your MySQL

AutoMySQLBackup is one of the great tools to backup multiple databases, compress the backups, back up remote databases, and email the logs. AutoMySQL lets you take daily, weekly and monthly backups of your MySQL databases using mysqldump (MySQL function to backup the databases).

Install AutoMySQLBackup:

1. Install AutoMySQLBackup:

[email protected]:/home/kartook# apt-get install AutoMySQLBackup

2. Configure AutoMySQLBackup:

[email protected]:/home/kartook# nano /etc/default/automysqlbackup

3. See the configuration below:

[…] # Host name (or IP address) of MySQL server e.g localhost
#For remote database, fill the domain or ip address
[…] # List of DBNAMES for Daily/Weekly Backup e.g. “DB1 DB2 DB3″
# The following is a quick hack that will find the names of the databases by
# reading the mysql folder content. Feel free to replace by something else.
#DBNAMES=”db_ispconfig web1 web2 web3″
DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d’/’ -f5 | grep -v ^mysql$ | tr \r\n , `
[…] # Backup directory location e.g /backups
# Folders inside this one will be created (daily, weekly, etc.), and the
# subfolders will be database names.
[…] # Email Address to send mail to? ([email protected])
MAILADDR=”[email protected]
[…] 4. Run AutoMySQLBackup:

4. Run AutoMySQLBackup:

5. Open the backup folder (default: /var/lib/automysqlbackup)

[email protected]:/home/kartook# ls -l /var/lib/automysqlbackup

6. You will see the backup files.
7. Add it to cron to run it automatically.

One thought on “AutoMySQLBackup: Regularly Backup Your MySQL

  1. Pingback: AutoMySQLBackup: Regularly Backup Your MySQL | CyberTechBlog.Com

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.