Created
December 31, 2014 20:39
-
-
Save jak119/154d585c92bd24f74031 to your computer and use it in GitHub Desktop.
Backup MySQL Databases to File
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 | |
#@author Jamison Kissh | |
#Schedule the job to run via a cron job | |
#edit line below to include password after -p | |
mysqldump -u root -p --all-databases | gzip > ./database`date +%F_%T`.sql.gz | |
#Remove backups older than five days | |
find ./database* -mtime +5 -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment