Created
April 29, 2011 09:20
-
-
Save nils-werner/948092 to your computer and use it in GitHub Desktop.
Periodic MySQL dumper
This file contains hidden or 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 | |
cd /home/nils/Server/mysql | |
mysqldump --all-databases --dump-date=FALSE > all.sql | |
git commit -a -m "Dump von $(date)" |
This file contains hidden or 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
0 * * * * /home/nils/Server/mysql/backup.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The parameter
--dump-date=FALSE
is necessary to hide the obligatory "Dump completed on 2011-04-29 12:00:03" line at the end of a dump.Hiding that line will dump the exact same file over and over again if nothing has changed in the database. Git will ignore files that haven't been changed and only commit if there was an actual change.