Sunday, January 15, 2012

MySQL Backup+email bash script

EDIT: January 11 2013 - I tried this on a newer Centos server and it appears the syntax to mutt has changed - you need to add "--" between the attachment and the destination email to have the command processed properly.

There are TONS of MySQL backup scripts around, but none on the first two pages of a Google search that did just what I wanted: backup each MySQL database on a server separately, then email them to me, one at a time. I found a few that were close, and modified them to do what I needed.  Credit is given to the original author when known.

Credit to jamesmcdonald.id.au for the bulk of the main script