Exclude named profiles from merge auto-promote; add RSYNC_MERGE_ENABLED toggle

This commit is contained in:
Gmer4Lfe
2026-06-14 21:34:49 -04:00
parent 11f3492d9d
commit 554822fc6a
2 changed files with 16 additions and 2 deletions
+11
View File
@@ -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.
+5 -2
View File
@@ -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)