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)"