Last active
August 29, 2015 14:13
-
-
Save danielhauck/cd84813b9beb0925184f to your computer and use it in GitHub Desktop.
Quick and dirty mysql backup
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
#!/usr/bin/env bash | |
for DATABASE in $(mysql -NBqe 'show databases' | grep -Ev "(information_schema|performance_schema)"); do | |
mysqldump --events ${DATABASE} | gzip > /srv/backup/$(date +%Y%m%d_%H%M)_${DATABASE}.gz; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment