From 554822fc6af463159366ce203179fe1465558973 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 14 Jun 2026 21:34:49 -0400 Subject: [PATCH] Exclude named profiles from merge auto-promote; add RSYNC_MERGE_ENABLED toggle --- Configurations/master.conf | 11 +++++++++++ Rsync/rsync.sh | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Configurations/master.conf b/Configurations/master.conf index 3cde8a7..6e95723 100644 --- a/Configurations/master.conf +++ b/Configurations/master.conf @@ -502,6 +502,17 @@ WEEKLY_RSYNC_ENABLED=true # Tier 2 — weekly_sync_maintenance.sh rsync section FALLBACK_RSYNC_ENABLED=true # Tier 2 — fallback.sh writeback jobs on handback +# ━━━ Download Webhook ━━━ +# Immediate push to remote nodes on every Sonarr/Radarr/Lidarr Download event. +# Prevents remotes from searching for content that is already on disk locally. + DOWNLOAD_WEBHOOK_ENABLED=true + +# ━━━ Rsync Merge Auto-Promote ━━━ +# When enabled, rsync.sh pre-scans the remote before syncing and promotes to merge +# mode (pull-then-push) if ≥75% of remote top-level entries exist locally. +# Named profiles are always excluded from auto-promote regardless of this toggle. + RSYNC_MERGE_ENABLED=true + # ━━━ Rsync Defaults ━━━ # Global fallback values used when no profile match is found. # Media shares in HOST*_DAILY_SYNC_SHARES always use these globals — no profile needed. diff --git a/Rsync/rsync.sh b/Rsync/rsync.sh index 64d8a36..1b6a54a 100755 --- a/Rsync/rsync.sh +++ b/Rsync/rsync.sh @@ -271,8 +271,11 @@ check_remote_disks "$DIRECTORY" # ── Merge-run pre-scan ──────────────────────────────────────────────────────────────────────── # Auto-promote to merge mode when ≥75% of remote's top-level entries exist locally. -# Skipped when --merge-run is already set or --seed is active (remote was just created). -if [[ "$MERGE_RUN" == false && "$SEED" == false ]]; then +# Skipped when: --merge-run is already set, --seed is active, a named profile is resolved, +# or RSYNC_MERGE_ENABLED=false in master.conf. +if [[ "$MERGE_RUN" == false && "$SEED" == false \ + && "${RSYNC_MERGE_ENABLED:-true}" != "false" \ + && -z "${PROFILE_RSYNC_OPTS[$PROFILE_NAME]+x}" ]]; then _remote_top=$(ssh -i "$SSH_KEY" -o ConnectTimeout=10 -o BatchMode=yes \ root@"$REMOTE_SERVER" "ls -1A '$DIRECTORY' 2>/dev/null | sort" 2>/dev/null) _remote_count=$(echo "$_remote_top" | grep -c . 2>/dev/null || echo 0)