From 9501648ce9f373f769f830bc2d90eb9265c97107 Mon Sep 17 00:00:00 2001 From: Christian Hase Date: Wed, 7 Apr 2021 19:19:42 +0200 Subject: [PATCH] Update backup.sh added --single-transaction parameter to "halt" the mysql database while exporting --- backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backup.sh b/backup.sh index 793c27e..a7cc487 100755 --- a/backup.sh +++ b/backup.sh @@ -14,7 +14,7 @@ do echo "==> Dumping database: $db" FILENAME=/backup/$DATE.$db.sql LATEST=/backup/latest.$db.sql.gz - if mysqldump -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" $db $MYSQLDUMP_OPTS > "$FILENAME" + if mysqldump --single-transaction -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" $db $MYSQLDUMP_OPTS > "$FILENAME" then gzip "-$GZIP_LEVEL" -f "$FILENAME" echo "==> Creating symlink to latest backup: $(basename "$FILENAME".gz)"