Robustness: Add fallback path handling in disaster-recovery.sh for NAS offline cases
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m15s

This commit is contained in:
2026-06-07 09:48:13 +02:00
parent 02a4a7ded8
commit c7299228cd

View File

@@ -37,6 +37,17 @@ fi
# Configuration defaults
NAS_BACKUP_DIR="${NAS_BACKUP_DIR:-/mnt/nas-backups/wordly}"
# Fallback to local backups folder if NAS directory is not writable
if [ ! -d "${NAS_BACKUP_DIR}" ]; then
mkdir -p "${NAS_BACKUP_DIR}" 2>/dev/null || true
fi
if [ ! -w "${NAS_BACKUP_DIR}" ]; then
log_warning "NAS backup directory '${NAS_BACKUP_DIR}' is not writable or mounted. Falling back to local backups folder."
NAS_BACKUP_DIR="${PROJECT_ROOT}/backups"
fi
DR_BACKUP_DIR="${NAS_BACKUP_DIR}/dr"
DR_RETENTION_DAYS=14