Backup and Email a MySQL Database
Posted on December 3, 2007 by Ben Cecka
I know there are a hundred and fifty scripts that do this, but I set out to do this within a single Crontab entry. I thought it would be nice to post and save others from having to suffer with combining a bunch of ridiculous scripts for such a simple task.
mysqldump -uusername -ppassword –all-databases | gzip > /pathto/db.gz && mutt -s Backup -a /pathto/db.gz email@domain.com < /dev/null
Voila. All data to be changed has been italicized to protect the innocent (and help you).
Technorati Tags: mysql, crontab, backup
Comments
Leave a Reply
