added rsync disable in master global tier 1, advanced selection tier 2

This commit is contained in:
2026-04-28 17:07:44 -04:00
parent 11872b802b
commit 1c765b7260
6 changed files with 96 additions and 6 deletions
+39
View File
@@ -339,6 +339,45 @@ resolve_remote_ip() {
# Pings remote and exits if unreachable.
# For failover use ping_remote() which returns status without exiting.
# -----------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------
# check_rsync_enabled — two-tier rsync gate check
# Tier 1: RSYNC_ENABLED — global, overrides everything
# Tier 2: orchestrator-specific flag passed as argument
#
# Usage:
# check_rsync_enabled "DAILY" ← checks RSYNC_ENABLED + DAILY_RSYNC_ENABLED
# check_rsync_enabled "WEEKLY" ← checks RSYNC_ENABLED + WEEKLY_RSYNC_ENABLED
# check_rsync_enabled "FAILOVER" ← checks RSYNC_ENABLED + FAILOVER_RSYNC_ENABLED
# check_rsync_enabled ← checks RSYNC_ENABLED only (rsync.sh direct call)
#
# Returns:
# 0 = rsync enabled, proceed
# 1 = rsync disabled, skip cleanly
# -----------------------------------------------------------------------------------------------
check_rsync_enabled() {
local orchestrator="${1:-}"
# Tier 1 — global gate
if [[ "${RSYNC_ENABLED:-true}" == false ]]; then
warn "RSYNC_ENABLED=false — rsync globally disabled, skipping all syncs"
return 1
fi
# Tier 2 — per-orchestrator
if [[ -n "$orchestrator" ]]; then
local var_name="${orchestrator}_RSYNC_ENABLED"
local var_value="${!var_name:-true}"
if [[ "$var_value" == false ]]; then
info "${var_name}=false — rsync disabled for $orchestrator orchestrator"
info "All other $orchestrator jobs will still run normally"
return 1
fi
fi
return 0
}
check_connectivity() {
log "Checking connectivity to $REMOTE_SERVER..."
if ! ping -c1 -W3 "$REMOTE_SERVER" &>/dev/null; then