reverted back before framework change

This commit is contained in:
2026-03-27 17:39:36 +00:00
parent 4fffcfea51
commit be849ed684
2 changed files with 154 additions and 157 deletions
+25 -21
View File
@@ -4,6 +4,7 @@ set -e
# ------------------------ Stop all running Rsync processes for Unraid -------------------------
# ----------------------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../Master.conf"
@@ -19,7 +20,7 @@ require_var "HOST2"
detect_hosts
resolve_remote_ip
# ----------------------------- POSITIONAL -----------------------------
# ----------------------------- POSITIONAL MAP -----------------------------
SOURCE="${POSITIONAL_ARGS[0]:-}"
DEST="${POSITIONAL_ARGS[1]:-}"
@@ -33,31 +34,37 @@ fi
# ----------------------------- HEADER -----------------------------
echo
echo "=================================================="
echo " 🚀 RSYNC START"
echo "=================================================="
ui_header "RSYNC OPERATION"
echo "[INFO] Source: $SOURCE"
echo "[INFO] Destination: $DEST"
echo "[INFO] Remote: $REMOTE_SERVER_NAME ($REMOTE_SERVER)"
echo "[INFO] DryRun: $DRY_RUN"
echo
ui_section "Context"
ui_kv "Source" "$SOURCE"
ui_kv "Destination" "$DEST"
ui_kv "Remote" "$REMOTE_SERVER_NAME"
ui_kv "IP" "$REMOTE_SERVER"
ui_kv "Dry Run" "$DRY_RUN"
# ----------------------------- VALIDATION -----------------------------
if [[ -z "$SOURCE" ]]; then
echo_error "Missing SOURCE"
echo_error "Missing SOURCE argument"
exit 1
fi
if [[ -z "$DEST" ]]; then
echo_error "Missing DEST"
echo_error "Missing DEST argument"
exit 1
fi
echo "[OK] Validation passed"
log "Validation completed successfully"
ui_status ok "Validation passed"
# ----------------------------- MIRROR MODE -----------------------------
if [[ "$SOURCE" == "$DEST" ]]; then
echo
echo "[INFO] Mirror mode detected (identical paths)"
echo "[INFO] Treating as cross-host sync of same structure"
log "Mirror mode active"
fi
# ----------------------------- PRECHECK -----------------------------
@@ -72,7 +79,7 @@ echo "[OK] Remote reachable"
stop_containers
# ----------------------------- RSYNC -----------------------------
# ----------------------------- RSYNC EXECUTION -----------------------------
get_rsync_opts
@@ -87,8 +94,8 @@ if [[ "$DRY_RUN" == true ]]; then
RSYNC_CMD+=("--dry-run")
fi
echo
echo "[RUN] Executing rsync..."
ui_section "Execution"
echo "[RUN] Starting rsync..."
log "CMD: ${RSYNC_CMD[*]}"
"${RSYNC_CMD[@]}"
@@ -99,7 +106,4 @@ start_containers
# ----------------------------- END -----------------------------
echo
echo "=================================================="
echo " ✅ RSYNC COMPLETE"
echo "=================================================="
ui_footer "RSYNC COMPLETE"