Created
October 20, 2011 23:08
-
-
Save fideloper/1302670 to your computer and use it in GitHub Desktop.
bash shell file for daily database backup - Run as CRON job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
/usr/bin/mysqldump --user=DB_USER --password='DB_PASSWORD' --databases DB_NAME | gzip > /path/to/backup/DB_NAME-`date +%Y%m%d%H%M`.sql.gz | |
find /path/to/backup -name "*.gz" -mtime +60 -exec /bin/rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment