User Tools

Site Tools


mysqlbackup

AutoMySQLBackup

AutoMySQLBackup is a small backup script for MySQL databases with a handling for daily, weekly and monthly backups.

The current version in the apt package is 2.5. There are newer versions available on the AutoMySQLBackup website.

Step 1: Install

sudo apt-get install automysqlbackup

Step 2: Configure

sudo nano /etc/default/automysqlbackup

The most important setup values are:

USERNAME=XXX
PASSWORD=YYY
BACKUPDIR="/var/lib/automysqlbackup"

Change rights for the config file (to protect the MySQL password):

sudo chmod 600 /etc/default/automysqlbackup

Setting up an entry in the crontab is not necessary. The apt package of automysqlbackup created a script for that in the folder:

/etc/cron.daily/

Step 3: Error correction

I found a small error in version 2.5. The fix is pretty easy.

Edit the AutoMySQLBackup script:

sudo nano /usr/sbin/automysqlbackup

Replace this line:

exec 2>&6 7>&-      # Restore stderr and close file descriptor #7.

with this line:

exec 2>&7 7>&-      # Restore stderr and close file descriptor #7.
mysqlbackup.txt · Last modified: 04.02.2014 19:16 by derk