From a7c14f9000c73d09961c4f288a09573b4eebe29e Mon Sep 17 00:00:00 2001 From: BeauTroll <-> Date: Wed, 17 Dec 2025 20:24:48 +0100 Subject: [PATCH] fix: use absolute paths for log files in all scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- scripts/backup.sh | 2 +- scripts/recover.sh | 2 +- scripts/restore.sh | 2 +- scripts/update.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index bc9c62a..1d94b1a 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -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" diff --git a/scripts/recover.sh b/scripts/recover.sh index d9c5edf..5444201 100755 --- a/scripts/recover.sh +++ b/scripts/recover.sh @@ -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" diff --git a/scripts/restore.sh b/scripts/restore.sh index 4be1e53..587ef44 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -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" diff --git a/scripts/update.sh b/scripts/update.sh index 142a8db..2ec5123 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -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=""