Created
October 25, 2018 15:13
-
-
Save thiagosf/2f33f07a7def7c349dd7a2b3cba8a70d to your computer and use it in GitHub Desktop.
Backup MySQL and compress it
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 | |
DATE=`date +%Y-%m-%d` | |
DATABASE='dbname' | |
USER='username' | |
PASS='password' | |
mysqldump -u $USER -p$PASS $DATABASE > dump-$DATE.sql | |
zip dump-$DATE.sql.zip dump-$DATE.sql | |
rm dump-$DATE.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment