From e294a4057d11d7c648eee52f8d96c11245b4def0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 20 Jul 2026 23:56:15 +0000 Subject: [PATCH 1/3] Initial plan From 68b86bdf49c19b5e00856077d9bf0d900deb7984 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Jul 2026 00:03:12 +0000 Subject: [PATCH 2/3] Fix rsync destination-directory failure: add sync_tree with mkdir -p, mount check, path-safety, stale-marker cleanup, and 19 behavioral tests --- .../scripts/sovran-hub-backup.sh | 75 +- app/tests/test_manual_backup_workflow.py | 656 +++++++++++++++++- 2 files changed, 706 insertions(+), 25 deletions(-) diff --git a/app/sovran_systemsos_web/scripts/sovran-hub-backup.sh b/app/sovran_systemsos_web/scripts/sovran-hub-backup.sh index ec27892..5a20db2 100755 --- a/app/sovran_systemsos_web/scripts/sovran-hub-backup.sh +++ b/app/sovran_systemsos_web/scripts/sovran-hub-backup.sh @@ -46,7 +46,8 @@ BACKUP_SUBPATH="Sovran_SystemsOS_Backup/current" # ── Logging helpers ────────────────────────────────────────────── log() { - local msg="[$(date '+%Y-%m-%d %H:%M:%S')] $*" + local msg + msg="[$(date '+%Y-%m-%d %H:%M:%S')] $*" echo "$msg" | tee -a "$BACKUP_LOG" } @@ -65,7 +66,9 @@ cleanup() { local rc=$? # Release the concurrency lock file descriptor if it was opened - [[ -n "${LOCK_FD:-}" ]] && exec {LOCK_FD}>&- 2>/dev/null || true + if [[ -n "${LOCK_FD:-}" ]]; then + exec {LOCK_FD}>&- 2>/dev/null || true + fi if [[ "$BACKUP_COMPLETE" -eq 1 && "$rc" -eq 0 ]]; then return @@ -222,15 +225,49 @@ estimate_path_bytes() { echo "$size" } -# ── Run rsync for one source tree ──────────────────────────────── +# ── Sync one source tree to its backup destination ─────────────── +# Usage: sync_tree