Server and system maintenance tools.
- ensure root/.my.cnf has necessary user credentials
- move /etc/cron.daily/logrotate to /etc/cron.hourly (to run logrotate hourly)
- mkdir -p /backups/mysql
- move mysqlbackup.sh to /root
- move logrotate.d-mysqlbackup to /etc/logrotate.d/mysqlbackup
- flavor to taste
Test: logrotate --force /etc/logrotate.d/mysqlbackup
Working on using Percona xtrabackup for incremental hot backups without locking the tables. See: https://www.digitalocean.com/community/tutorials/how-to-configure-mysql-backups-with-percona-xtrabackup-on-ubuntu-16-04 (and other documentation)
This could be massively improved by creating a backup user on the filesystem and in the mysql database, and using that user instead.