diff --git a/Tools/Manual-Tools.md b/Tools/Manual-Tools.md index fe2d333..20f4484 100644 --- a/Tools/Manual-Tools.md +++ b/Tools/Manual-Tools.md @@ -24,6 +24,23 @@ making any changes. --- +## Output Tiers + +All tools have two output levels controlled by `--log`. + +Without `--log`, each script processes and always concludes with a summary block +showing identity, duration, counts, and a status line. Warnings and errors are +always visible. State-display scripts (watchdog_skip_list_manager, zfs_pool_scrub +`--status`, fallback_state_reset current-state section) always show their state +output — `--log` adds configuration detail and per-item resolution within each +section. + +With `--log`, per-item detail appears: individual items added/skipped, per-database +check results, per-pool scan lines, per-container stop/start state, per-directory +creation results. Use when debugging unexpected results or confirming a first run. + +--- + ## emby_to_lidarr_sync.sh One-shot bootstrap tool. Scans Emby play history, finds artists you've actually diff --git a/Tools/container_data_export.sh b/Tools/container_data_export.sh index 86a7af2..0e186d4 100644 --- a/Tools/container_data_export.sh +++ b/Tools/container_data_export.sh @@ -304,7 +304,7 @@ echo "" if [[ "$DRY_RUN" == true ]]; then warn "DRY RUN — no changes made" elif [[ "$ARCHIVE_VERIFIED" == true && "$RESTART_OK" == true ]]; then - log "$ICON_DONE Status: done — $ARCHIVE_NAME" + echo "$ICON_DONE Status: done — $ARCHIVE_NAME" elif [[ "$ARCHIVE_VERIFIED" == false ]]; then echo "$ICON_ERROR Status: archive verification FAILED — check backup before relying on it" else diff --git a/Tools/emby_database_repair.sh b/Tools/emby_database_repair.sh index 2c02060..a0e8550 100644 --- a/Tools/emby_database_repair.sh +++ b/Tools/emby_database_repair.sh @@ -352,7 +352,7 @@ echo "$ICON_TIME Duration: $(format_duration $(( END - START )))" echo "" echo " $ICON_SUCCESS Passed: ${#PASS_DBS[@]}" [[ ${#FAIL_DBS[@]} -gt 0 ]] && echo " $ICON_ERROR Failed: ${#FAIL_DBS[@]}" -[[ ${#MISSING_DBS[@]} -gt 0 ]] && log "Skipped: ${#MISSING_DBS[@]} (not found)" +[[ ${#MISSING_DBS[@]} -gt 0 ]] && echo " Skipped: ${#MISSING_DBS[@]} (not found)" echo "" [[ ${#PASS_DBS[@]} -gt 0 ]] && for db in "${PASS_DBS[@]}"; do log " $ICON_SUCCESS $db"; done @@ -378,7 +378,7 @@ elif [[ ${#FAIL_DBS[@]} -gt 0 ]]; then notify "Emby database CORRUPTION on $(hostname) — failed: ${FAIL_DBS[*]} — manual intervention needed" \ "Emby DB Repair" "warning" else - log "$ICON_DONE Status: all ${#PASS_DBS[@]} databases healthy ✅" + echo "$ICON_DONE Status: all ${#PASS_DBS[@]} databases healthy ✅" fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" diff --git a/Tools/emby_to_lidarr_sync.sh b/Tools/emby_to_lidarr_sync.sh index 4fe5930..f64378f 100755 --- a/Tools/emby_to_lidarr_sync.sh +++ b/Tools/emby_to_lidarr_sync.sh @@ -224,13 +224,13 @@ IFS=$'\n' MISSING=($(printf '%s\n' "${MISSING[@]}" | sort)) echo " Already tracked: $ALREADY | Missing from Lidarr: ${#MISSING[@]}" if [[ "${#MISSING[@]}" -eq 0 ]]; then - log "Lidarr already tracks everything played on Emby" + echo "Lidarr already tracks everything played on Emby" exit 0 fi echo "" echo "━━━ $ICON_SUMMARY Artists to add (${#MISSING[@]}) ━━━" -for a in "${MISSING[@]}"; do echo " $a"; done +for a in "${MISSING[@]}"; do log " $a"; done if [[ "$DRY_RUN" == true ]]; then warn "DRY RUN complete — run without --dry-run to add these artists" diff --git a/Tools/emby_to_radarr_sync.sh b/Tools/emby_to_radarr_sync.sh index ad0b178..ce0f1bc 100644 --- a/Tools/emby_to_radarr_sync.sh +++ b/Tools/emby_to_radarr_sync.sh @@ -229,7 +229,7 @@ IFS=$'\n' SORTED_MISSING=($(printf '%s\n' "${!MISSING[@]}" | sort)) echo " Already tracked: $ALREADY | Missing from Radarr: ${#MISSING[@]}" if [[ "${#MISSING[@]}" -eq 0 ]]; then - log "Radarr already tracks everything in Emby" + echo "Radarr already tracks everything in Emby" exit 0 fi @@ -237,7 +237,7 @@ echo "" echo "━━━ $ICON_SUMMARY Movies to add (${#MISSING[@]}) ━━━" for name in "${SORTED_MISSING[@]}"; do _tmdb="${MISSING[$name]}" - echo " $name${_tmdb:+ (TMDB: $_tmdb)}" + log " $name${_tmdb:+ (TMDB: $_tmdb)}" done if [[ "$DRY_RUN" == true ]]; then diff --git a/Tools/emby_to_sonarr_sync.sh b/Tools/emby_to_sonarr_sync.sh index 7497a23..be497a7 100644 --- a/Tools/emby_to_sonarr_sync.sh +++ b/Tools/emby_to_sonarr_sync.sh @@ -239,7 +239,7 @@ IFS=$'\n' SORTED_MISSING=($(printf '%s\n' "${!MISSING[@]}" | sort)) echo " Already tracked: $ALREADY | Missing from Sonarr: ${#MISSING[@]}" if [[ "${#MISSING[@]}" -eq 0 ]]; then - log "Sonarr already tracks everything in Emby" + echo "Sonarr already tracks everything in Emby" exit 0 fi @@ -247,7 +247,7 @@ echo "" echo "━━━ $ICON_SUMMARY Series to add (${#MISSING[@]}) ━━━" for name in "${SORTED_MISSING[@]}"; do _tvdb="${MISSING[$name]}" - echo " $name${_tvdb:+ (TVDB: $_tvdb)}" + log " $name${_tvdb:+ (TVDB: $_tvdb)}" done if [[ "$DRY_RUN" == true ]]; then diff --git a/Tools/fallback_state_reset.sh b/Tools/fallback_state_reset.sh index b58ee11..138d539 100644 --- a/Tools/fallback_state_reset.sh +++ b/Tools/fallback_state_reset.sh @@ -151,7 +151,7 @@ if pgrep -f "fallback.sh" >/dev/null 2>&1; then echo "" warn "If you are sure you want to proceed anyway, confirm below" else - log "fallback.sh is not running — safe to reset ✅" + echo "fallback.sh is not running — safe to reset ✅" fi # Check current state — if already NORMAL warn user @@ -238,8 +238,8 @@ if [[ "$DRY_RUN" == true ]]; then warn "DRY RUN — no changes made" else warn "$ICON_DONE State reset to NORMAL" - log "fallback.sh will resume from NORMAL on next cycle" - log "No containers were started or stopped" + echo "fallback.sh will resume from NORMAL on next cycle" + echo "No containers were started or stopped" echo "" [[ "$FALLBACK_RUNNING" == true ]] && \ warn "⚠️ fallback.sh was running during reset — monitor next cycle carefully" diff --git a/Tools/recreate_shares.sh b/Tools/recreate_shares.sh index 95fe1ab..822d10d 100644 --- a/Tools/recreate_shares.sh +++ b/Tools/recreate_shares.sh @@ -293,6 +293,6 @@ elif [[ ${#FAILED[@]} -gt 0 ]]; then "Recreate Shares" "warning" exit 1 else - log "$ICON_DONE Status: done — ${#CREATED[@]} created, ${#SKIPPED[@]} skipped" + echo "$ICON_DONE Status: done — ${#CREATED[@]} created, ${#SKIPPED[@]} skipped" fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" \ No newline at end of file diff --git a/Tools/watchdog_skip_list_manager.sh b/Tools/watchdog_skip_list_manager.sh index e915530..8a2964c 100644 --- a/Tools/watchdog_skip_list_manager.sh +++ b/Tools/watchdog_skip_list_manager.sh @@ -152,7 +152,7 @@ fi echo "" if [[ "$SKIP_COUNT" -eq 0 ]]; then - log "Skip list: empty — all containers monitored normally ✅" + echo "Skip list: empty — all containers monitored normally ✅" else warn "$SKIP_COUNT container(s) on skip list — manual intervention needed:" echo "" @@ -177,9 +177,9 @@ fi echo "" echo "━━━ $ICON_WATCHDOG Restart History ━━━" if [[ "$RESTART_COUNT" -eq 0 ]]; then - log "No restart history" + echo "No restart history" else - log "$RESTART_COUNT restart entries (window: ${WATCHDOG_CONTAINER_RESTART_WINDOW}h)" + echo "$RESTART_COUNT restart entries (window: ${WATCHDOG_CONTAINER_RESTART_WINDOW}h)" echo "" awk -F'|' '{counts[$1]++} END { for (c in counts) diff --git a/Tools/zfs_pool_scrub.sh b/Tools/zfs_pool_scrub.sh index 8febee2..1bf7b05 100644 --- a/Tools/zfs_pool_scrub.sh +++ b/Tools/zfs_pool_scrub.sh @@ -281,7 +281,7 @@ for pool in "${STARTED[@]}"; do error " $ERRORS" POOLS_ERRORS+=("$pool") else - log "$pool — $SCAN_LINE" + echo "$pool — $SCAN_LINE" POOLS_OK+=("$pool") fi done @@ -304,7 +304,7 @@ if [[ ${#POOLS_ERRORS[@]} -gt 0 ]]; then notify "ZFS scrub errors on $(hostname) ($MY_ID) — pools with errors: ${POOLS_ERRORS[*]}" \ "ZFS Scrub" "warning" elif [[ ${#POOLS_OK[@]} -gt 0 ]]; then - log "$ICON_DONE Status: all ${#POOLS_OK[@]} pools clean ✅" + echo "$ICON_DONE Status: all ${#POOLS_OK[@]} pools clean ✅" fi echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"