From c9ffe0cb5fb9a3641615ef65a48cd59726404e60 Mon Sep 17 00:00:00 2001 From: shuki Date: Sat, 7 Mar 2026 06:11:02 +0200 Subject: [PATCH] Fix log filename collisions: use local time instead of UTC Log filenames used UTC time while cron runs in local time, causing different runs to generate the same filename (e.g. 04:00 local and 06:00 local both mapped to 04:00 UTC). Use local time for log filenames to ensure each run gets a unique file. Co-Authored-By: Claude Opus 4.6 --- lib/logging.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logging.sh b/lib/logging.sh index f25900f..5dca36c 100644 --- a/lib/logging.sh +++ b/lib/logging.sh @@ -20,7 +20,7 @@ init_logging() { local log_dir="${LOG_DIR:-/var/log/gniza}" mkdir -p "$log_dir" || die "Cannot create log directory: $log_dir" - LOG_FILE="$log_dir/gniza-$(date -u +%Y%m%d-%H%M%S).log" + LOG_FILE="$log_dir/gniza-$(date +%Y%m%d-%H%M%S).log" touch "$LOG_FILE" || die "Cannot write to log file: $LOG_FILE" # Clean old logs