Created
September 8, 2009 03:46
-
-
Save jamesbrooks/182703 to your computer and use it in GitHub Desktop.
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 | |
# configuration | |
PROJECT_NAME='Foo' | |
PATH_TO_BACKUPS='/backups/foo_database_backups' | |
RECIPIENT_EMAIL='[email protected]' | |
DATABASE_USERNAME='root' | |
DATABASE_PASSWORD='password' | |
DATABASE_DATABASE='database_name' | |
# end of configuration. should not need to edit from this point | |
TIMESTAMP=`date +%F_%T` | |
OUTFILE="$PATH_TO_BACKUPS/$TIMESTAMP.sql" | |
mysqldump -u$DATABASE_USERNAME -p$DATABASE_PASSWORD $DATABASE_DATABASE > $OUTFILE | |
bzip2 $OUTFILE | |
mutt -a $OUTFILE.bz2 -s "Database/$PROJECT_NAME for $TIMESTAMP" $RECIPIENT_EMAIL < /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment