summaryrefslogtreecommitdiffstats
path: root/create-mysql-dumps
diff options
context:
space:
mode:
Diffstat (limited to 'create-mysql-dumps')
-rwxr-xr-xcreate-mysql-dumps10
1 files changed, 10 insertions, 0 deletions
diff --git a/create-mysql-dumps b/create-mysql-dumps
new file mode 100755
index 0000000..2bec29c
--- /dev/null
+++ b/create-mysql-dumps
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+mysql_opts="--defaults-file=/root/backup/mysql-defaults-backup"
+backupdir="/root/backup/mysql-dumps/"
+
+for db in $(mysql $mysql_opts -e 'show databases' -s --skip-column-names); do
+ if [[ $db != "information_schema" && $db != "performance_schema" ]]; then
+ mysqldump $mysql_opts "$db" --quick --create-options --disable-keys --add-locks --add-drop-table --lock-tables --complete-insert --skip-extended-insert | gzip > "$backupdir/$db.sql.gz"
+ fi
+done