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
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m15s
This commit is contained in:
@@ -37,6 +37,17 @@ fi
|
|||||||
|
|
||||||
# Configuration defaults
|
# Configuration defaults
|
||||||
NAS_BACKUP_DIR="${NAS_BACKUP_DIR:-/mnt/nas-backups/wordly}"
|
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_BACKUP_DIR="${NAS_BACKUP_DIR}/dr"
|
||||||
DR_RETENTION_DAYS=14
|
DR_RETENTION_DAYS=14
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user