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