Verbose logging: add config dump log() calls to Monitors, Media, Tools, Rsync, Fallback

This commit is contained in:
Gmer4Lfe
2026-06-04 21:37:53 -04:00
parent 369a9e6c19
commit 127b070f7b
33 changed files with 67 additions and 3 deletions
+3
View File
@@ -304,6 +304,9 @@ DOCKER_TIMEOUT=15
SSH_TIMEOUT=10 SSH_TIMEOUT=10
CONTAINER_VERIFY_WAIT=5 # seconds after start before verifying container is up CONTAINER_VERIFY_WAIT=5 # seconds after start before verifying container is up
log "$ICON_GEAR Config: check-interval=${FALLBACK_CHECK_INTERVAL}s handback-strikes=${FALLBACK_HANDBACK_STRIKES} partnership-required=${FALLBACK_PARTNERSHIP_REQUIRED:-true} rsync-enabled=${FALLBACK_RSYNC_ENABLED:-true}"
log "$ICON_GEAR Timeouts: docker=${DOCKER_TIMEOUT}s ssh=${SSH_TIMEOUT}s verify-wait=${CONTAINER_VERIFY_WAIT}s"
# ============================================================================================== # ==============================================================================================
# ── STATE FILE HELPERS ──────────────────────────────────────────────────────────────────────── # ── STATE FILE HELPERS ────────────────────────────────────────────────────────────────────────
# ============================================================================================== # ==============================================================================================
+1
View File
@@ -181,6 +181,7 @@ if [[ ! -f "$FALLBACK_SCRIPT" ]]; then
exit 1 exit 1
fi fi
log "fallback.sh found at $FALLBACK_SCRIPT" log "fallback.sh found at $FALLBACK_SCRIPT"
log "$ICON_GEAR Config: remote=${REMOTE_SERVER_NAME} (${REMOTE_SERVER}) fallback-script=${FALLBACK_SCRIPT}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no iptables rules or container changes will be made" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no iptables rules or container changes will be made"
+3
View File
@@ -186,6 +186,9 @@ if [[ "$ARR_SYNC_ENABLED" != "true" ]]; then
exit 0 exit 0
fi fi
log "$ICON_GEAR Config: api-timeout=${ARR_SYNC_API_TIMEOUT}s connect-timeout=${ARR_SYNC_CONNECT_TIMEOUT}s blocklist=${ARR_SYNC_BLOCKLIST}"
log "$ICON_GEAR Ports: lidarr=${ARR_SYNC_LIDARR_PORT} sonarr=${ARR_SYNC_SONARR_PORT} radarr=${ARR_SYNC_RADARR_PORT}"
# ── Arr type definitions ─────────────────────────────────────────────────────────────────────── # ── Arr type definitions ───────────────────────────────────────────────────────────────────────
# Each arr type maps to its port, API version, endpoint, stable ID field, and display name field # Each arr type maps to its port, API version, endpoint, stable ID field, and display name field
declare -A _PORT=([lidarr]="$ARR_SYNC_LIDARR_PORT" [sonarr]="$ARR_SYNC_SONARR_PORT" [radarr]="$ARR_SYNC_RADARR_PORT") declare -A _PORT=([lidarr]="$ARR_SYNC_LIDARR_PORT" [sonarr]="$ARR_SYNC_SONARR_PORT" [radarr]="$ARR_SYNC_RADARR_PORT")
+2
View File
@@ -122,6 +122,8 @@ platform_require_cmd \
# Age threshold in seconds # Age threshold in seconds
AGE_THRESHOLD_SECONDS=$(( ARR_IMPORT_RECOVERY_AGE * 3600 )) AGE_THRESHOLD_SECONDS=$(( ARR_IMPORT_RECOVERY_AGE * 3600 ))
log "$ICON_GEAR Config: age-threshold=${ARR_IMPORT_RECOVERY_AGE}hr sonarr-v${SONARR_VERSION_MAJOR} radarr-v${RADARR_VERSION_MAJOR} lidarr-v${LIDARR_VERSION_MAJOR:-?}"
TOTAL_ACTIONED=0 TOTAL_ACTIONED=0
TOTAL_SKIPPED=0 TOTAL_SKIPPED=0
ARR_SUMMARIES=() ARR_SUMMARIES=()
+1
View File
@@ -200,6 +200,7 @@ if [[ ! -d "$LIDARR_MUSIC_ROOT" ]]; then
exit 1 exit 1
fi fi
log "$ICON_GEAR Config: url=${LIDARR_URL} root=${LIDARR_MUSIC_ROOT}"
echo " $MY_ID ($LOCAL_SERVER_NAME) — $LIDARR_URL" echo " $MY_ID ($LOCAL_SERVER_NAME) — $LIDARR_URL"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted"
+1
View File
@@ -108,6 +108,7 @@ if [[ -z "$LIDARR_URL" ]]; then
fi fi
info "$MY_ID ($LOCAL_SERVER_NAME) — tools OK" info "$MY_ID ($LOCAL_SERVER_NAME) — tools OK"
log "$ICON_GEAR Config: url=${LIDARR_URL}"
# ============================================================================================== # ==============================================================================================
# ━━━ Status ━━━ # ━━━ Status ━━━
+1
View File
@@ -89,6 +89,7 @@ parse_args "${_FILTERED[@]}"
SYNC_DAYS="${PLAY_SYNC_DAYS:-90}" SYNC_DAYS="${PLAY_SYNC_DAYS:-90}"
SYNC_TYPES="${PLAY_SYNC_TYPES:-Movie,Episode,Audio}" SYNC_TYPES="${PLAY_SYNC_TYPES:-Movie,Episode,Audio}"
[[ "$FULL_SYNC" == true ]] && SYNC_DAYS=0 [[ "$FULL_SYNC" == true ]] && SYNC_DAYS=0
log "$ICON_GEAR Config: days=${SYNC_DAYS} types=${SYNC_TYPES} remote=${PLAY_SYNC_REMOTE:-true}"
command -v jq >/dev/null 2>&1 || { error "jq is required but not installed"; exit 1; } command -v jq >/dev/null 2>&1 || { error "jq is required but not installed"; exit 1; }
+2
View File
@@ -158,6 +158,8 @@ USER_CAP_PCT="${LIDARR_DISCOVERY_USER_CAP_PCT:-35}"
REJECT_COOLDOWN="${LIDARR_DISCOVERY_REJECT_COOLDOWN:-30}" REJECT_COOLDOWN="${LIDARR_DISCOVERY_REJECT_COOLDOWN:-30}"
HISTORY_FILE="${LIDARR_DISCOVERY_HISTORY:-${DATA_DIR}/lidarr_discovery_history.db}" HISTORY_FILE="${LIDARR_DISCOVERY_HISTORY:-${DATA_DIR}/lidarr_discovery_history.db}"
log "$ICON_GEAR Config: threshold=${THRESHOLD} lookback=${LOOKBACK_DAYS}d min-plays=${MIN_PLAYS} max-adds=${MAX_ADDS} user-cap=${USER_CAP_PCT}% reject-cooldown=${REJECT_COOLDOWN}d"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no artists will be added to Lidarr" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no artists will be added to Lidarr"
# ============================================================================================== # ==============================================================================================
+2
View File
@@ -162,6 +162,8 @@ REJECT_COOLDOWN="${RADARR_DISCOVERY_REJECT_COOLDOWN:-60}"
HISTORY_FILE="${RADARR_DISCOVERY_HISTORY:-${DATA_DIR}/radarr_discovery_history.db}" HISTORY_FILE="${RADARR_DISCOVERY_HISTORY:-${DATA_DIR}/radarr_discovery_history.db}"
SEED_LIBRARIES=("${RADARR_DISCOVERY_SEED_LIBRARIES[@]:-Movies}") SEED_LIBRARIES=("${RADARR_DISCOVERY_SEED_LIBRARIES[@]:-Movies}")
log "$ICON_GEAR Config: threshold=${THRESHOLD} lookback=${LOOKBACK_DAYS}d max-seeds=${MAX_SEEDS} max-adds=${MAX_ADDS} min-votes=${MIN_VOTE_COUNT} min-rating=${MIN_RATING} reject-cooldown=${REJECT_COOLDOWN}d"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no movies will be added to Radarr" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no movies will be added to Radarr"
_fmt_rating() { local v="${1:-0}"; echo "${v::-1}.${v: -1}" 2>/dev/null || echo "$v"; } _fmt_rating() { local v="${1:-0}"; echo "${v::-1}.${v: -1}" 2>/dev/null || echo "$v"; }
+2
View File
@@ -182,6 +182,8 @@ USER_EPISODE_CAP="${SONARR_DISCOVERY_USER_EPISODE_CAP:-8}"
MONITOR_MODE="${SONARR_DISCOVERY_MONITOR_MODE:-all}" MONITOR_MODE="${SONARR_DISCOVERY_MONITOR_MODE:-all}"
HISTORY_FILE="${SONARR_DISCOVERY_HISTORY:-${DATA_DIR}/sonarr_discovery_history.db}" HISTORY_FILE="${SONARR_DISCOVERY_HISTORY:-${DATA_DIR}/sonarr_discovery_history.db}"
log "$ICON_GEAR Config: threshold=${THRESHOLD} lookback=${LOOKBACK_DAYS}d max-seeds=${MAX_SEEDS} max-adds=${MAX_ADDS} min-votes=${MIN_VOTE_COUNT} min-rating=${MIN_RATING} reject-cooldown=${REJECT_COOLDOWN}d monitor=${MONITOR_MODE}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no shows will be added to Sonarr" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no shows will be added to Sonarr"
_fmt_rating() { local v="${1:-0}"; echo "${v::-1}.${v: -1}" 2>/dev/null || echo "$v"; } _fmt_rating() { local v="${1:-0}"; echo "${v::-1}.${v: -1}" 2>/dev/null || echo "$v"; }
+1
View File
@@ -180,6 +180,7 @@ if [[ ! -d "$RADARR_MOVIES_ROOT" ]]; then
exit 1 exit 1
fi fi
log "$ICON_GEAR Config: url=${RADARR_URL} root=${RADARR_MOVIES_ROOT}"
echo " $MY_ID ($LOCAL_SERVER_NAME) — $RADARR_URL" echo " $MY_ID ($LOCAL_SERVER_NAME) — $RADARR_URL"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted"
+1
View File
@@ -101,6 +101,7 @@ fi
ADD_EXCLUSION="${RADARR_DROPPED_ADD_EXCLUSION:-true}" ADD_EXCLUSION="${RADARR_DROPPED_ADD_EXCLUSION:-true}"
log "$ICON_GEAR Config: url=${RADARR_URL} add-exclusion=${ADD_EXCLUSION} delete-files=${DELETE_FILES:-false}"
echo " $MY_ID ($LOCAL_SERVER_NAME) — $RADARR_URL" echo " $MY_ID ($LOCAL_SERVER_NAME) — $RADARR_URL"
[[ "$DELETE_FILES" == true ]] && warn "DELETE FILES MODE — files will be removed from disk" [[ "$DELETE_FILES" == true ]] && warn "DELETE FILES MODE — files will be removed from disk"
[[ "$DELETE_FILES" == false ]] && echo " Files: records only (use --delete-files to also remove from disk)" [[ "$DELETE_FILES" == false ]] && echo " Files: records only (use --delete-files to also remove from disk)"
+1
View File
@@ -180,6 +180,7 @@ if [[ ! -d "$SONARR_TV_ROOT" ]]; then
exit 1 exit 1
fi fi
log "$ICON_GEAR Config: url=${SONARR_URL} root=${SONARR_TV_ROOT}"
echo " $MY_ID ($LOCAL_SERVER_NAME) — $SONARR_URL" echo " $MY_ID ($LOCAL_SERVER_NAME) — $SONARR_URL"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no files will be deleted"
+1
View File
@@ -100,6 +100,7 @@ fi
ADD_EXCLUSION="${SONARR_DROPPED_ADD_EXCLUSION:-true}" ADD_EXCLUSION="${SONARR_DROPPED_ADD_EXCLUSION:-true}"
log "$ICON_GEAR Config: url=${SONARR_URL} add-exclusion=${ADD_EXCLUSION} delete-files=${DELETE_FILES:-false}"
echo " $MY_ID ($LOCAL_SERVER_NAME) — $SONARR_URL" echo " $MY_ID ($LOCAL_SERVER_NAME) — $SONARR_URL"
[[ "$DELETE_FILES" == true ]] && warn "DELETE FILES MODE — files will be removed from disk" [[ "$DELETE_FILES" == true ]] && warn "DELETE FILES MODE — files will be removed from disk"
[[ "$DELETE_FILES" == false ]] && echo " Files: records only (use --delete-files to also remove from disk)" [[ "$DELETE_FILES" == false ]] && echo " Files: records only (use --delete-files to also remove from disk)"
+7
View File
@@ -144,6 +144,10 @@ if [[ ${#VERIFY_SHARES[@]} -eq 0 ]]; then
exit 0 exit 0
fi fi
log "$ICON_GEAR Config: sample=${BACKUP_VERIFY_SAMPLE} min-size=${BACKUP_VERIFY_MIN_SIZE} ssh-timeout=${SSH_TIMEOUT}s"
log "$ICON_GEAR Remote: $REMOTE_ID ($REMOTE_SERVER_NAME$REMOTE_SERVER)"
log "$ICON_GEAR Shares: ${VERIFY_SHARES[*]}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — showing sample selection only, no checksums computed" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — showing sample selection only, no checksums computed"
# ============================================================================================== # ==============================================================================================
@@ -177,12 +181,14 @@ resolve_remote_ip
# Connectivity — no point making 100+ SSH calls if remote is unreachable # Connectivity — no point making 100+ SSH calls if remote is unreachable
check_connectivity check_connectivity
log "Connectivity to $REMOTE_SERVER_NAME"
# Version parity — mismatched unRAID could cause md5sum path differences # Version parity — mismatched unRAID could cause md5sum path differences
check_unraid_version_parity || { check_unraid_version_parity || {
warn "Version parity check failed — proceeding with caution" warn "Version parity check failed — proceeding with caution"
warn "Checksum results may be unreliable if md5sum path changed between versions" warn "Checksum results may be unreliable if md5sum path changed between versions"
} }
log "Version parity with $REMOTE_SERVER_NAME"
# Remote array — if array is down all files appear "missing" = false alarm # Remote array — if array is down all files appear "missing" = false alarm
if ! check_remote_array; then if ! check_remote_array; then
@@ -192,6 +198,7 @@ if ! check_remote_array; then
"Backup Verify" "warning" "Backup Verify" "warning"
exit 1 exit 1
fi fi
log "Remote array mounted on $REMOTE_SERVER_NAME"
echo "Pre-flight passed ✅" echo "Pre-flight passed ✅"
+2
View File
@@ -142,6 +142,8 @@ platform_require_cmd \
# detect_hosts() sets MY_ID for report header # detect_hosts() sets MY_ID for report header
detect_hosts detect_hosts
log "$ICON_GEAR Config: log=${BANDWIDTH_LOG} retention=${BANDWIDTH_LOG_RETENTION}d warn=${BANDWIDTH_WARN_GB}GB"
# ============================================================================================== # ==============================================================================================
# ━━━ Status ━━━ # ━━━ Status ━━━
# ============================================================================================== # ==============================================================================================
+2
View File
@@ -128,6 +128,8 @@ if [[ ${#CERT_MONITOR_DOMAINS[@]} -eq 0 ]]; then
fi fi
info "Domains to check: ${#CERT_MONITOR_DOMAINS[@]}" info "Domains to check: ${#CERT_MONITOR_DOMAINS[@]}"
log "$ICON_GEAR Config: warn=${CERT_WARN_DAYS}d crit=${CERT_CRIT_DAYS}d timeout=${CERT_TIMEOUT}s"
log "$ICON_GEAR Domains: ${CERT_MONITOR_DOMAINS[*]}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — results shown but no notifications sent" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — results shown but no notifications sent"
+5 -2
View File
@@ -124,7 +124,7 @@ detect_hosts
require_var EMBY_URL require_var EMBY_URL
require_var EMBY_API_KEY require_var EMBY_API_KEY
log "Emby: $EMBY_URL" log "$ICON_GEAR Config: url=${EMBY_URL} period=${EMBY_REPORT_DAYS}d top=${EMBY_REPORT_TOP_N}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — API queried but no notification sent" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — API queried but no notification sent"
# ============================================================================================== # ==============================================================================================
@@ -190,7 +190,7 @@ SYSTEM_INFO=$(emby_api "System/Info" 2>/dev/null) || {
SERVER_NAME=$(echo "$SYSTEM_INFO" | jq -r '.ServerName // "Unknown"' 2>/dev/null) SERVER_NAME=$(echo "$SYSTEM_INFO" | jq -r '.ServerName // "Unknown"' 2>/dev/null)
SERVER_VERSION=$(echo "$SYSTEM_INFO" | jq -r '.Version // "Unknown"' 2>/dev/null) SERVER_VERSION=$(echo "$SYSTEM_INFO" | jq -r '.Version // "Unknown"' 2>/dev/null)
log "Connected to: $SERVER_NAME (v$SERVER_VERSION)" log "$ICON_EMBY Connected to: $SERVER_NAME (v$SERVER_VERSION)"
# ── Active Sessions ─────────────────────────────────────────────────────────────────────────── # ── Active Sessions ───────────────────────────────────────────────────────────────────────────
echo "━━━ $ICON_EMBY Active Sessions ━━━" echo "━━━ $ICON_EMBY Active Sessions ━━━"
@@ -216,6 +216,7 @@ if [[ "$ACTIVE_COUNT" -gt 0 ]]; then
" \(.UserName // "Unknown") → \(.NowPlayingItem.Name // "Unknown") [\(if .TranscodingInfo != null then "transcode" else "direct" end)]" " \(.UserName // "Unknown") → \(.NowPlayingItem.Name // "Unknown") [\(if .TranscodingInfo != null then "transcode" else "direct" end)]"
' 2>/dev/null || true ' 2>/dev/null || true
fi fi
log "$ICON_EMBY Sessions: $ACTIVE_COUNT active ($DIRECT_NOW direct / $TRANSCODE_NOW transcode)"
echo "" echo ""
# ── Library Stats ───────────────────────────────────────────────────────────────────────────── # ── Library Stats ─────────────────────────────────────────────────────────────────────────────
@@ -229,6 +230,7 @@ SONG_COUNT=$(echo "$ITEMS" | jq '.SongCount // 0' 2>/dev/null || echo 0)
echo " $ICON_EMBY Movies: $MOVIE_COUNT" echo " $ICON_EMBY Movies: $MOVIE_COUNT"
echo " $ICON_EMBY Episodes: $EPISODE_COUNT" echo " $ICON_EMBY Episodes: $EPISODE_COUNT"
echo " $ICON_EMBY Songs: $SONG_COUNT" echo " $ICON_EMBY Songs: $SONG_COUNT"
log "$ICON_EMBY Library: $MOVIE_COUNT movies $EPISODE_COUNT episodes $SONG_COUNT songs"
echo "" echo ""
# ── Activity History ────────────────────────────────────────────────────────────────────────── # ── Activity History ──────────────────────────────────────────────────────────────────────────
@@ -256,6 +258,7 @@ if [[ "$TOTAL_PLAYS" -gt 0 ]]; then
DIRECT_PCT=$(( 100 - TRANSCODE_PCT )) DIRECT_PCT=$(( 100 - TRANSCODE_PCT ))
echo " $ICON_EMBY Direct play: ~${DIRECT_PCT}%" echo " $ICON_EMBY Direct play: ~${DIRECT_PCT}%"
echo " $ICON_EMBY Transcoded: ~${TRANSCODE_PCT}%" echo " $ICON_EMBY Transcoded: ~${TRANSCODE_PCT}%"
log "$ICON_EMBY Activity: $TOTAL_PLAYS plays — ~${DIRECT_PCT}% direct / ~${TRANSCODE_PCT}% transcode"
fi fi
echo "" echo ""
+2
View File
@@ -71,6 +71,7 @@ format_delay() {
} }
collect_hosts collect_hosts
log "$ICON_HOST Hosts: ${ALL_HOST_IDS[*]} (${#ALL_HOST_IDS[@]} in mesh)"
# ============================================================================================== # ==============================================================================================
# ━━━ Status ━━━ # ━━━ Status ━━━
@@ -127,6 +128,7 @@ for h in "${ALL_HOST_IDS[@]}"; do
email_var="${h}_OWNER_EMAIL"; email="${!email_var:-(not set)}" email_var="${h}_OWNER_EMAIL"; email="${!email_var:-(not set)}"
printf " %-${W_HOST}s %-${W_SERVER}s %-${W_OWNER}s %s\n" \ printf " %-${W_HOST}s %-${W_SERVER}s %-${W_OWNER}s %s\n" \
"$h" "$server" "$owner" "$email" "$h" "$server" "$owner" "$email"
log "$h: server=$server owner=$owner email=$email"
done done
# ── Protected Services ──────────────────────────────────────────────────────────────────────── # ── Protected Services ────────────────────────────────────────────────────────────────────────
+4 -1
View File
@@ -123,6 +123,8 @@ acquire_lock
# detect_hosts() sets MY_ID — used in warning output # detect_hosts() sets MY_ID — used in warning output
detect_hosts detect_hosts
log "$ICON_GEAR Config: inotify-warn=${INOTIFY_WARN_PCT:-80}% php-fpm-warn=${PHP_FPM_WARN_PCT:-80}% max-workers=${PHP_MAX_CHILDREN:-250} retention=${TUNING_LOG_RETENTION:-30}d"
DATE=$(date '+%Y-%m-%d') DATE=$(date '+%Y-%m-%d')
TIME=$(date '+%H:%M') TIME=$(date '+%H:%M')
INOTIFY_WARN=0 INOTIFY_WARN=0
@@ -245,4 +247,5 @@ fi
echo "${DATE}|${TIME}|${INOTIFY_USED}|${INOTIFY_LIMIT}|${INOTIFY_PCT}|${INOTIFY_WARN}|${PHPFPM_ACTIVE}|${PHPFPM_MAX}|${PHPFPM_PCT}|${PHPFPM_WARN}" \ echo "${DATE}|${TIME}|${INOTIFY_USED}|${INOTIFY_LIMIT}|${INOTIFY_PCT}|${INOTIFY_WARN}|${PHPFPM_ACTIVE}|${PHPFPM_MAX}|${PHPFPM_PCT}|${PHPFPM_WARN}" \
>> "$TUNING_MONITOR_LOG" >> "$TUNING_MONITOR_LOG"
echo "Snapshot written: inotify ${INOTIFY_PCT}% php-fpm ${PHPFPM_PCT}%" echo "Snapshot written: inotify ${INOTIFY_PCT}% php-fpm ${PHPFPM_PCT}%"
log "Entry: ${DATE}|${TIME}|${INOTIFY_USED}/${INOTIFY_LIMIT}(${INOTIFY_PCT}%,warn=${INOTIFY_WARN})|${PHPFPM_ACTIVE}/${PHPFPM_MAX}(${PHPFPM_PCT}%,warn=${PHPFPM_WARN})"
+6
View File
@@ -141,6 +141,9 @@ acquire_lock
# detect_hosts() sets MY_ID and aliases all host-specific vars used in this report # detect_hosts() sets MY_ID and aliases all host-specific vars used in this report
detect_hosts detect_hosts
log "$ICON_GEAR Config: profile=${DIGEST_PROFILE} day=${DIGEST_DAY}"
log "$ICON_GEAR Smart triggers: watchdog=${DIGEST_SMART_ON_WATCHDOG} fallback=${DIGEST_SMART_ON_FALLBACK} cert=${DIGEST_SMART_ON_CERT_WARN} bandwidth=${DIGEST_SMART_ON_BANDWIDTH}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — report generated but no notification sent" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — report generated but no notification sent"
# ============================================================================================== # ==============================================================================================
@@ -199,6 +202,7 @@ ISSUES=() # need attention
DIGEST_LINES=() # full report lines DIGEST_LINES=() # full report lines
# ── fallback State ──────────────────────────────────────────────────────────────────────────── # ── fallback State ────────────────────────────────────────────────────────────────────────────
log "Reading: fallback=$FALLBACK_STATE_FILE skip=$DOCKER_WATCHDOG_FAILED_FILE watchdog=$WATCHDOG_STATE_FILE sys=$SYS_WATCHDOG_STATE_FILE"
if [[ -f "$FALLBACK_STATE_FILE" ]]; then if [[ -f "$FALLBACK_STATE_FILE" ]]; then
FALLBACK_STATE=$(grep "^state=" "$FALLBACK_STATE_FILE" 2>/dev/null | cut -d= -f2) FALLBACK_STATE=$(grep "^state=" "$FALLBACK_STATE_FILE" 2>/dev/null | cut -d= -f2)
if [[ -n "$FALLBACK_STATE" ]]; then if [[ -n "$FALLBACK_STATE" ]]; then
@@ -323,6 +327,8 @@ if [[ ${#CERT_MONITOR_DOMAINS[@]} -gt 0 ]] && command -v openssl >/dev/null 2>&1
elif [[ "$days_remaining" -le "${CERT_WARN_DAYS:-30}" ]]; then elif [[ "$days_remaining" -le "${CERT_WARN_DAYS:-30}" ]]; then
CERT_ISSUES+=("$domain: ${days_remaining}d warning") CERT_ISSUES+=("$domain: ${days_remaining}d warning")
[[ "$DIGEST_SMART_ON_CERT_WARN" == true ]] && SHOULD_SEND=true [[ "$DIGEST_SMART_ON_CERT_WARN" == true ]] && SHOULD_SEND=true
else
log "$ICON_CERT $domain: ${days_remaining}d remaining ✅"
fi fi
fi fi
done done
+1
View File
@@ -143,6 +143,7 @@ done
log "Identity: $MY_ID ($LOCAL_SERVER_NAME)" log "Identity: $MY_ID ($LOCAL_SERVER_NAME)"
log "Ignoring pools: ${ZFS_REPORT_IGNORE_POOLS[*]:-none}" log "Ignoring pools: ${ZFS_REPORT_IGNORE_POOLS[*]:-none}"
log "$ICON_GEAR Config: arc-warn=${ZFS_REPORT_ARC_WARN_PCT}% free-warn=${ZFS_REPORT_FREE_WARN_GB}GB avail-warn=${ZFS_REPORT_AVAIL_WARN_GB}GB docker-top=${ZFS_REPORT_DOCKER_TOP}"
# Tee output to log file unless dry run # Tee output to log file unless dry run
if [[ "$DRY_RUN" == false ]]; then if [[ "$DRY_RUN" == false ]]; then
+3
View File
@@ -219,6 +219,9 @@ read -r -a REMOTE_RESTART_CONTAINERS <<< "${PROFILE_REMOTE_RESTART_CONTAINE
# Local containers use same names as remote (mirrored naming scheme) # Local containers use same names as remote (mirrored naming scheme)
LOCAL_CRITICAL_CONTAINER_NAMES=("${CRITICAL_CONTAINER_NAMES[@]}") LOCAL_CRITICAL_CONTAINER_NAMES=("${CRITICAL_CONTAINER_NAMES[@]}")
log "$ICON_GEAR Config: profile=${PROFILE_NAME} bw-limit=${BW_LIMIT}KB/s retry=${RETRY_COUNT} sleep=${SLEEP}s container-delay=${CONTAINER_DELAY}s"
log "$ICON_GEAR Containers: critical=${CRITICAL_CONTAINER_NAMES[*]:-none} delayed=${DELAYED_CONTAINERS[*]:-none} remote-restart=${REMOTE_RESTART_CONTAINERS[*]:-none}"
[[ "$SHOW_STATUS" == true ]] && show_status && exit 0 [[ "$SHOW_STATUS" == true ]] && show_status && exit 0
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
+2
View File
@@ -61,6 +61,8 @@ detect_hosts
CONF_FILE="$SCRIPTS_ROOT/Configurations/${MY_ID,,}.conf" CONF_FILE="$SCRIPTS_ROOT/Configurations/${MY_ID,,}.conf"
[[ ! -f "$CONF_FILE" ]] && { error "Conf file not found: $CONF_FILE"; exit 1; } [[ ! -f "$CONF_FILE" ]] && { error "Conf file not found: $CONF_FILE"; exit 1; }
log "$ICON_GEAR Config: conf=${CONF_FILE} overwrite=${OVERWRITE:-false} no-push=${NO_PUSH:-false}"
UPDATED=0 UPDATED=0
SKIPPED=0 SKIPPED=0
+1
View File
@@ -99,6 +99,7 @@ fi
# ━━━ Run ━━━ # ━━━ Run ━━━
# ============================================================================================== # ==============================================================================================
MODE_LABEL=$([[ "$ALL_MODE" == true ]] && echo "full orphan cleanup" || echo "dangling only") MODE_LABEL=$([[ "$ALL_MODE" == true ]] && echo "full orphan cleanup" || echo "dangling only")
log "$ICON_GEAR Config: mode=${MODE_LABEL} dry-run=${DRY_RUN}"
echo "━━━ $ICON_CONTAINERS Docker Prune Images ($MODE_LABEL) — $(date '+%Y-%m-%d %H:%M:%S') ━━━" echo "━━━ $ICON_CONTAINERS Docker Prune Images ($MODE_LABEL) — $(date '+%Y-%m-%d %H:%M:%S') ━━━"
TOTAL_RECLAIMED=0 TOTAL_RECLAIMED=0
+1
View File
@@ -83,6 +83,7 @@ if [[ -z "${LIDARR_URL:-}" || -z "${LIDARR_API_KEY:-}" ]]; then
fi fi
log "$ICON_GEAR Config: emby=${EMBY_URL} lidarr=${LIDARR_URL}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no artists will be added to Lidarr" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no artists will be added to Lidarr"
# ============================================================================================== # ==============================================================================================
+1
View File
@@ -84,6 +84,7 @@ if [[ -z "${RADARR_URL:-}" || -z "${RADARR_API_KEY:-}" ]]; then
exit 1 exit 1
fi fi
log "$ICON_GEAR Config: emby=${EMBY_URL} radarr=${RADARR_URL}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no movies will be added to Radarr" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no movies will be added to Radarr"
# ============================================================================================== # ==============================================================================================
+1
View File
@@ -84,6 +84,7 @@ if [[ -z "${SONARR_URL:-}" || -z "${SONARR_API_KEY:-}" ]]; then
exit 1 exit 1
fi fi
log "$ICON_GEAR Config: emby=${EMBY_URL} sonarr=${SONARR_URL}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no series will be added to Sonarr" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no series will be added to Sonarr"
# ============================================================================================== # ==============================================================================================
+1
View File
@@ -98,6 +98,7 @@ acquire_lock
# detect_hosts() sets MY_ID — used in summary and notification # detect_hosts() sets MY_ID — used in summary and notification
detect_hosts detect_hosts
log "$ICON_GEAR Config: state-file=${FALLBACK_STATE_FILE}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
[[ "$FORCE" == true ]] && warn "FORCE mode — confirmation prompt skipped" [[ "$FORCE" == true ]] && warn "FORCE mode — confirmation prompt skipped"
+1
View File
@@ -106,6 +106,7 @@ acquire_lock
# detect_hosts() sets MY_ID — used in summary # detect_hosts() sets MY_ID — used in summary
detect_hosts detect_hosts
log "$ICON_GEAR Config: cfg-dir=${SHARE_CFG_DIR} marker=${MARKER_FILE}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no directories or markers will be created" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no directories or markers will be created"
# ============================================================================================== # ==============================================================================================
+2
View File
@@ -40,6 +40,8 @@ done
mkdir -p /tmp/vv_cache mkdir -p /tmp/vv_cache
log "$ICON_GEAR Config: target=${TARGET_HOST:-all hosts} ssh-key=${SSH_KEY}"
FETCH_OK=0 FETCH_OK=0
FETCH_FAIL=0 FETCH_FAIL=0
FETCH_SKIP=0 FETCH_SKIP=0
+2
View File
@@ -107,6 +107,8 @@ SRC="$SCRIPTS_DIR"
DST=$([[ "$TO_MODE" == "internal" ]] && echo "$INTERNAL_DIR" || echo "$FLASH_DIR") DST=$([[ "$TO_MODE" == "internal" ]] && echo "$INTERNAL_DIR" || echo "$FLASH_DIR")
NEW_INTERNAL=$([[ "$TO_MODE" == "internal" ]] && echo "true" || echo "false") NEW_INTERNAL=$([[ "$TO_MODE" == "internal" ]] && echo "true" || echo "false")
log "$ICON_GEAR Config: to=${TO_MODE} src=${SRC} dst=${DST} dry-run=${DRY_RUN}"
echo "" echo ""
echo "━━━━━ $ICON_SYNC Storage Migration ━━━━━" echo "━━━━━ $ICON_SYNC Storage Migration ━━━━━"
echo "$ICON_GEAR From: $SRC" echo "$ICON_GEAR From: $SRC"
+1
View File
@@ -124,6 +124,7 @@ fi
# detect_hosts() sets MY_ID — used in output # detect_hosts() sets MY_ID — used in output
detect_hosts detect_hosts
log "$ICON_GEAR Config: action=${ACTION} container=${TARGET_CONTAINER:-all} skip-file=${DOCKER_WATCHDOG_FAILED_FILE}"
[[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made" [[ "$DRY_RUN" == true ]] && warn "DRY RUN — no changes will be made"
[[ "$FORCE" == true ]] && warn "FORCE mode — confirmation prompt skipped" [[ "$FORCE" == true ]] && warn "FORCE mode — confirmation prompt skipped"