fix: use absolute paths for log files in all scripts
Fixed issue where log file redirections would fail when scripts change directories. All scripts now use $PROJECT_ROOT/logs/... instead of relative paths ./logs/... This prevents errors like "Aucun fichier ou dossier de ce nom" when scripts execute commands in different directories (e.g., checksum verification in restore.sh). Affected files: - scripts/backup.sh - scripts/restore.sh - scripts/update.sh - scripts/recover.sh 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ set +a
|
||||
DATE=$(date +%Y%m%d_%H%M%S)
|
||||
LOCK_FILE="/tmp/nextcloud_backup.lock"
|
||||
LOG_DIR="./logs"
|
||||
LOG_FILE="$LOG_DIR/backup_$(date +%Y%m%d_%H%M%S).log"
|
||||
LOG_FILE="$PROJECT_ROOT/logs/backup_$(date +%Y%m%d_%H%M%S).log"
|
||||
BACKUP_DIR="${BACKUP_DESTINATION:-./backups}"
|
||||
BACKUP_RETENTION_DAYS="${BACKUP_RETENTION_DAYS:-7}"
|
||||
BACKUP_NAME="nextcloud_backup_$DATE"
|
||||
|
||||
@@ -10,7 +10,7 @@ cd "$PROJECT_ROOT"
|
||||
|
||||
# Configuration des logs
|
||||
LOG_DIR="./logs"
|
||||
LOG_FILE="$LOG_DIR/recover_$(date +%Y%m%d_%H%M%S).log"
|
||||
LOG_FILE="$PROJECT_ROOT/logs/recover_$(date +%Y%m%d_%H%M%S).log"
|
||||
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ set +a
|
||||
|
||||
# Configuration des logs
|
||||
LOG_DIR="./logs"
|
||||
LOG_FILE="$LOG_DIR/restore_$(date +%Y%m%d_%H%M%S).log"
|
||||
LOG_FILE="$PROJECT_ROOT/logs/restore_$(date +%Y%m%d_%H%M%S).log"
|
||||
TEMP_DIR=""
|
||||
|
||||
mkdir -p "$LOG_DIR"
|
||||
|
||||
@@ -10,7 +10,7 @@ cd "$PROJECT_ROOT"
|
||||
|
||||
# Configuration des logs
|
||||
LOG_DIR="./logs"
|
||||
LOG_FILE="$LOG_DIR/update_$(date +%Y%m%d_%H%M%S).log"
|
||||
LOG_FILE="$PROJECT_ROOT/logs/update_$(date +%Y%m%d_%H%M%S).log"
|
||||
MAINTENANCE_ENABLED=false
|
||||
COMPOSE_BACKUP=""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user