Monthly Archives: August 2013

Rsnapshot in Ubunt 12.04 LTS – Incremental Backups

Rsnapshot combines rsync and a diff comparison between production and backup over multiple time frames. I’ve found it to be quite handy. Digital Ocean has a pretty good write up on it here. The only modifications to the tutorial were:

  • Excluding backups on a hourly, weekly, and monthly basis.
  • Changing the port used in SSH

For future reference and in case the page disappears, a copy can be downloaded here

 

Backing Up MySQL in Ubuntu 12.04

Install  automysqlbackup via:

apt-get install automysqlbackup

Then update the config file:

vi /etc/default/automysqlbackup

Then change this line from:

DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | tr \\\r\\\n ,\ `

to

DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | grep -v ^performance_schema$ | tr \\\r\\\n ,\ `

This fixes the lock tables error. As referenced here and here.

You then need to set your configuration file’s backup directory. In the same file, change the BACKUPDIR variable.

You can then test your installation by running

sudo automysqlbackup

The job is initiated on daily basis in the /etc/cron.daily/automysqlbackup

Sources