CentOS 7 - automysqlbackup

These settings are only good for relatively small InnoDB database, backup will be run by cron every night at 1am.

# mkdir ~/automysqlbackup && cd ~/automysqlbackup
# wget https://downloads.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup%20VER%203.0/automysqlbackup-v3.0_rc6.tar.gz
# tar xvzf ./automysqlbackup-v3.0_rc6.tar.gz
#./install.sh
<enter>
<enter>

# vim /usr/local/bin/automysqlbackup

:% s/--single-transaction/--single-transaction' '--skip-lock-tables/g

# chmod 755 /usr/local/bin/automysqlbackup
# mv /etc/automysqlbackup/myserver.conf /etc/automysqlbackup/example.conf
# chown example.example /etc/automysqlbackup/example.conf
# mkdir /var/backup
# chown example.example /var/backup

$ vim /etc/automysqlbackup/example.conf
CONFIG_mysql_dump_username='db_user_name'
CONFIG_mysql_dump_password='db_user_password'
CONFIG_mysql_dump_host='127.0.0.1'
CONFIG_mysql_dump_host_friendly='example.com'
CONFIG_backup_dir='/var/backup/db'
CONFIG_db_names=( 'db_name' )
CONFIG_db_month_names=( 'db_name' )
CONFIG_rotation_daily=3    # how many days we want to keep daily backups - this means only for last 3 days, normally it is 7
CONFIG_rotation_weekly=25    # how many days we want to keep weekly backups - this means only for last 3 weeks, normally it is 5
CONFIG_rotation_monthly=150    # how many days we want to keep monthly backups - this means only for last 6 months
CONFIG_mysql_dump_single_transaction='yes'
CONFIG_mysql_dump_latest='yes'    # we want extra file in 'latest' directory to be copied to external backup service
CONFIG_mail_address='admin@example.com'    # put an email address you read, test from command line that emails are delivered to your mailbox (mail -s "test" admin@example.com)

$ automysqlbackup -b -c /etc/automysqlbackup/example.conf
$ ls -laRh /var/backup
$ crontab -e
0 1 * * * /usr/local/bin/automysqlbackup -b -c /etc/automysqlbackup/example.conf >/dev/null 2>&1