From 33b4ae473221b83b46a1d593f4105abbb4e58983 Mon Sep 17 00:00:00 2001 From: Marlon Baeten Date: Fri, 26 Apr 2024 12:07:02 +0200 Subject: [PATCH] Disable no-lock --- README.md | 3 --- bin/docker-file-backup.sh | 10 +--------- bin/docker-psql-backup.sh | 11 +---------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 34fcf76..c7ff741 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,6 @@ The account id of the account that has write access to the backblaze repository. The secret account key of the account that has write access to the backblaze repository. -### TGBS_BACKUP_LOCK -If this is set to `1`, the `--no-lock` flag will not be set. - ### TGBS_BACKUP_TAGS If this is set, then the backup is tagged with the value of this environment variable. Different tags can be comma-separated. If the variable is not set, diff --git a/bin/docker-file-backup.sh b/bin/docker-file-backup.sh index 5e48444..a4144eb 100755 --- a/bin/docker-file-backup.sh +++ b/bin/docker-file-backup.sh @@ -25,20 +25,12 @@ if [ ! -z "$TGBS_BACKUP_PATH" ]; then done fi - TGBS_BACKUP_LOCKFILE=true - if [ -z "$TGBS_BACKUP_LOCK" ] || [ "$TGBS_BACKUP_LOCK" == "0" ] || [ "$TGBS_BACKUP_LOCK" == "false" ]; then - backup_cmd+=( "--no-lock" ) - TGBS_BACKUP_LOCKFILE=false - fi - backup_cmd+=( "$TGBS_BACKUP_PATH" ) if [ "${#TGBS_BACKUP_TAGS_CLEAN[@]}" -gt 0 ]; then IFS=',' echoerr "--- Using tags for restic snapshot: ${TGBS_BACKUP_TAGS_CLEAN[*]}" fi - if [ "${TGBS_BACKUP_LOCKFILE}" = false ]; then - echoerr "--- WARNING: Not using a lockfile" - fi + echoerr "--- Creating restic snapshot from $TGBS_BACKUP_PATH to repository $RESTIC_REPOSITORY" # Run the restic command diff --git a/bin/docker-psql-backup.sh b/bin/docker-psql-backup.sh index 668b25a..d709320 100755 --- a/bin/docker-psql-backup.sh +++ b/bin/docker-psql-backup.sh @@ -163,22 +163,13 @@ if [ -n "$TGBS_PSQL_BACKUP" ] && [ "$TGBS_PSQL_BACKUP" != "0" ] && [ "$TGBS_PSQL done fi - # Add option for the --no-lock command line flag for restic added by tg - TGBS_PSQL_BACKUP_LOCKFILE=true - if [ -z "$TGBS_BACKUP_LOCK" ] || [ "$TGBS_BACKUP_LOCK" == "0" ] || [ "$TGBS_BACKUP_LOCK" == "false" ]; then - backup_cmd+=( "--no-lock" ) - TGBS_PSQL_BACKUP_LOCKFILE=false - fi - # Backup all previously created psql files backup_cmd+=( "${TGBS_PSQL_BACKUP_FILENAMES[@]}" ) if [ "${#TGBS_PSQL_BACKUP_TAGS_CLEAN[@]}" -gt 0 ]; then IFS=',' echoerr "--- Using tags for restic snapshot: ${TGBS_PSQL_BACKUP_TAGS_CLEAN[*]}" fi - if [ "${TGBS_PSQL_BACKUP_LOCKFILE}" = false ]; then - echoerr "--- WARNING: Not using a lockfile" - fi + echoerr "--- Creating restic snapshot from PostgreSQL backup to repository $RESTIC_REPOSITORY" # Run the restic command