New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
For use with rsync, use 'dateext' to make it behave better
courtesy of http://www.leaseweblabs.com/2013/06/logrotate-and-rsync-mysqldump-backups/
Damn, I thought I invented this Thanks @tchen.
Nice
Still counts as an independent invention, just not first But thanks for posting it though - I hadn't even thought to use it like that. You've opened pandora's box. Oh the mischief! :P
Here's the version I use. It includes gzip max compression and automatically reads mysql credentials from file.
Step 1: Create file /root/.my.cnf with content below.
Step 2:
chmod 600 /root/.my.cnf
Step 3:
mkdir -p /opt/mysqldump
Step 4: (Important)
touch /opt/mysqldump/db.sql.gz
Step 5: Create file /etc/logrotate.d/mysql-backup.conf. Customize backup frequency and number of archives kept according to your needs.
Step 6: Set up rsync to backup directory /opt/mysqldump.
Why not automysqlbackup ?
I backup MySQL databases and other stuff by dumping/copying them into another directory and then commit/push those into a remote git repository. I get an offsite copy and have a complete history of what changed without having to muck around with zipped/gzipped files.