Aug 25 2010

MySQL Backups Made Easy

Category: ComputerTuxevara @ 21:23

Using logrotate makes it very easy to create MySQL dumps regularly. Just create a file at /etc/logrotate.d/ with the following content:

/var/backups/mysql/dump.sql {
daily
rotate 14
missingok
compress
postrotate
/usr/bin/mysqldump -u -p --opt \
--flush-logs --all-databases > /var/backups/mysql/dump.sql
endscript
}

You may have to create the directory /var/backups/mysql/ manually.

Tags: , ,

 

Leave a Reply