From 3e4b906f7ebe7a3e38a7266f586824322a3b7eea Mon Sep 17 00:00:00 2001 From: shuki Date: Fri, 6 Mar 2026 16:48:14 +0200 Subject: [PATCH] Only create log files for backup/restore/retention commands Utility commands (schedule, snapshots, remotes, etc.) were creating empty 0 B log files on every invocation. Now init_logging only runs for commands that produce meaningful log output. Co-Authored-By: Claude Opus 4.6 --- bin/gniza | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/gniza b/bin/gniza index 76ab22c..bef59b6 100755 --- a/bin/gniza +++ b/bin/gniza @@ -106,7 +106,10 @@ elif [[ -f "$CONFIG_DIR/gniza.conf" ]]; then load_config fi -init_logging +# Only create log files for operations that produce meaningful output +case "${SUBCOMMAND:-}" in + backup|restore|retention) init_logging ;; +esac # ── Parse subcommand flags helper ──────────────────────────── _parse_flag() {