From e1b700b10e4c06a488bb3be5a43dc67075bc8bac Mon Sep 17 00:00:00 2001 From: NuklearRabbit <145918611+NuklearRabbit@users.noreply.github.com> Date: Mon, 10 Aug 2026 16:19:18 +0200 Subject: [PATCH] M27: make backup checksums portable --- deploy/unraid/backup-postgres.sh | 3 ++- deploy/unraid/scheduled-backup.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/unraid/backup-postgres.sh b/deploy/unraid/backup-postgres.sh index cc3f5ca..97f56c1 100755 --- a/deploy/unraid/backup-postgres.sh +++ b/deploy/unraid/backup-postgres.sh @@ -22,7 +22,8 @@ docker compose -p "$project" $compose_files exec -T db sh -eu -c \ docker compose -p "$project" $compose_files exec -T db pg_restore --list \ < "$temporary_file" > /dev/null mv "$temporary_file" "$backup_file" -sha256sum "$backup_file" > "${backup_file}.sha256" +(cd "$destination" && \ + sha256sum "$(basename "$backup_file")" > "$(basename "$backup_file").sha256") BACKUP_RETENTION_DAYS="$retention_days" BACKUP_MINIMUM_COPIES="$minimum_copies" \ ./deploy/unraid/prune-postgres-backups.sh "$destination" trap - EXIT INT TERM diff --git a/deploy/unraid/scheduled-backup.sh b/deploy/unraid/scheduled-backup.sh index 00b5a03..9c0b8f4 100755 --- a/deploy/unraid/scheduled-backup.sh +++ b/deploy/unraid/scheduled-backup.sh @@ -21,7 +21,7 @@ while true; do --host=db --username="$POSTGRES_USER" "$POSTGRES_DB" > "$temporary" \ && pg_restore --list "$temporary" > /dev/null; then mv "$temporary" "$target" - sha256sum "$target" > "$target.sha256" + (cd "$destination" && sha256sum "$(basename "$target")" > "$(basename "$target").sha256") if [ -n "$secondary" ]; then cp "$target" "$target.sha256" "$secondary/" fi