
Originally Posted by
redsox9
Apparently not; he updated his original post to state that the database backup did not work.
Thought I would share the cron job that DOES email the bzipped db backup successfully as a file attached to an email.
Code:
mysqldump -ce --user=USERNAME --password=PASSWORD database_name | bzip2 > ~/DBBackup.`date +\%F`.tar.bz2; uuencode ~/DBBackup.`date +\%F`.tar.bz2 DBBackup.`date +\%F`.tar.bz2 | mail -s "The new DB Backup" Sendtoemail@address.com; rm ~/DBBackup.`date +\%F`.tar.bz2
I.e. three steps separated by semicolons: mysqldump; uuencode and send mail; delete the file once it has been sent. Hope this comes in handy.