diff --git a/backup.sh b/backup.sh index 14c3f5c..88937c4 100755 --- a/backup.sh +++ b/backup.sh @@ -13,7 +13,7 @@ # backup mysql dbFile="${backupDir}/db/${currentDate}.sql" -docker-compose exec nextcloud-database sh -c 'mysqldump --lock-tables --default-character-set=utf8mb4 -uroot -p"${MYSQL_ROOT_PASSWORD}" ${MYSQL_DATABASE}' > ${dbFile} +docker-compose exec nextcloud-database sh -c 'mysqldump --single-transaction=TRUE --lock-tables --default-character-set=utf8mb4 -uroot -p"${MYSQL_ROOT_PASSWORD}" ${MYSQL_DATABASE}' > ${dbFile} sed -i "/^mysqldump: \\[Warning\\]/d" ${dbFile} tar -cj ${dbFile} -f "${dbFile}.tbz2" rm ${dbFile}