From bf6624b60745011b08e34adfdbef116c6827fae3 Mon Sep 17 00:00:00 2001 From: shuki Date: Thu, 5 Mar 2026 05:33:55 +0200 Subject: [PATCH] Add daily stats collection cron job at 05:00 UTC The gniza stats command is now automatically scheduled when install_schedules() runs, tagged as # gniza:_stats so it is managed alongside backup schedules (installed/removed together). Co-Authored-By: Claude Opus 4.6 --- lib/schedule.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/schedule.sh b/lib/schedule.sh index 7461f4e..04ea9c1 100644 --- a/lib/schedule.sh +++ b/lib/schedule.sh @@ -206,6 +206,10 @@ install_schedules() { filtered+="$line"$'\n' done <<< "$current_crontab" + # Append daily stats collection (runs at 05:00 UTC) + new_lines+="${GNIZA_CRON_TAG}_stats"$'\n' + new_lines+="0 5 * * * /usr/local/bin/gniza stats >> /var/log/gniza/cron-stats.log 2>&1"$'\n' + # Append new lines local final="${filtered}${new_lines}"