MySQL Forums
Forum List  »  Newbie

Need to receive email confirmation after MySQL Backup completes
Posted by: akhtar malik
Date: September 16, 2014 12:45PM

Hi,

I am running the following code to backup mysql server by using Cron job. I would like to receive an email after this backup completes. Any help would be appreciated.

Thanks.

=======================================================================
mysql -u <user> -<pwd> -e 'show databases' | grep -Ev 'Database|information_schema|performance_schema' | while read dbname; do mysqldump -u <user> -<pwd> --complete-insert "$dbname" | gzip > ./backups/"$dbname"-`date +%Y-%m-%d-%T`.sql.gz; done

find ./backups/*.sql -mtime +2 -type f -delete

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.