automysqlbackup is a utility program that is available in the Ubuntu repositories.
This utility can be scheduled to automatically perform backups at regular intervals.
To install, type the following into the terminal:
$ sudo apt-get install automysqlbackup
$ sudo automysqlbackup
A folder structure and initial backups will be performed immediately.
The default location for backups is /var/lib/automysqlbackup.
List contents of this directory to see the folder structure:
$ ls /var/lib/automysqlbackup
You should see three directories for the daily, weekly and monthly
backups being performed automatically by automysqlbackup and a subdirectory
for each database containing the respective gzipped SQL dump.
The configuration file for automysqlbackup is located at /etc/default/automysqlbackup.
Open it in your favorite editor:
sudo vi /etc/default/automysqlbackup
This file assigns many variables by the MySQL file located at /etc/mysql/debian.cnf.
It reads the user, password, and databases to be backed up. All default configurations
can be left intact. You are now able to sleep well at night, knowing that your customer’s
data will be backed up at regular intervals.