-
-
Save slomo/1788725 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 | |
TARGET="/backup/mysql" | |
egrep -v "^(#|\\s*$)" /etc/duply/default/enabledDBs | while read DATABASE ; do | |
# this works securly for all tables in this database. It locks all tables (no read or write) and dumps them. | |
# Inculding creat db-statment. The quick options dumps to ram, and flushes then. This leads to less locktime. | |
mysqldump --lock-tables --quick --databases ${DATABASE} | gzip > ${TARGET}/${DATABASE}.mysql.gz | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment