Posts Tagged ‘cron jobs’

Backing up a mysql Database to your email

Saturday, October 17th, 2009

I needed to backup a mysql database on a computer different from the one on which it was running and I set a cron task executing the commands below:


mysqldump -ce --user=username --password=password dbname | gzip | uuencode dbbackup_e.gz | mail email@address.com

The backup file in compressed .gz format will be mailed to the email that you specify and will always have a small size as a result of the enconding and compression.

Enjoy as you backup your data!