From 682ba9d64da5349825aae6948acb6a3e96b91c33 Mon Sep 17 00:00:00 2001 From: Kevin Bataille Date: Sat, 25 Jul 2026 21:46:35 +0200 Subject: [PATCH] feat: exclude per-site log/ directories from the archive nginx access/error logs (and any other per-site log/ dir) change on every request, so they showed up as modified in every single backup - pure noise, no recovery value. Exclude any path containing a log/ directory (re:/log/) from borg create. Co-Authored-By: Claude Sonnet 5 --- borg-backup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/borg-backup.sh b/borg-backup.sh index 9109619..dad64af 100755 --- a/borg-backup.sh +++ b/borg-backup.sh @@ -244,7 +244,9 @@ fi # MariaDB stays up throughout: the dump above is already transactionally # consistent, and the container's raw data directory carries a .nobackup # marker (excluded here via --exclude-if-present) so its live files are -# never read by borg. +# never read by borg. Per-site log/ dirs (nginx access/error logs etc.) +# are excluded too - they churn on every request, so backing them up adds +# noise and dedup overhead for no recovery value. step "Step 2: Creating archive $ARCHIVE" container_running "$DB_CONTAINER" \ || { log "ERROR: $DB_CONTAINER is not running - refusing to archive"; exit 1; } @@ -257,6 +259,7 @@ run_cmd timeout --signal=INT --kill-after=120s "$CREATE_TIMEOUT" \ --exclude-caches \ --exclude-if-present .nobackup \ --keep-exclude-tags \ + --exclude 're:/log/' \ "::$ARCHIVE" \ "$TARGET"