Add full banner headers to all scripts across the codebase

Every script now has the established header format: PURPOSE with ─────── separator,
OPERATIONAL MODEL, DESIGN PRINCIPLES, OPERATIONAL SAFEGUARDS, CONFIGURATION, and
RUNTIME MODES — structured with full ====== banner sections throughout.

Orchestrators converted from compact ── inline format to full banners. Stale
emby-fallback and dirty sync references removed from Plugin/user_script_plug-in.sh.
This commit is contained in:
Gmer4Lfe
2026-06-26 18:50:05 -04:00
parent 1003bee72a
commit f92ee4064b
51 changed files with 1822 additions and 563 deletions
+28 -42
View File
@@ -3,30 +3,36 @@
# ============================= USER SCRIPTS MASTER TEMPLATE ===================================
# ==============================================================================================
#
# Paste this file into a User Script entry. Uncomment ONE script block and set the schedule.
# Every script in the ecosystem is listed here — from the orchestrators that run it all,
# down to the individual scripts you can run standalone for specific tasks.
# PURPOSE
# ─────────────────────────────────────────────────────────────────────────────
# Paste this file into a User Script entry. Uncomment ONE script block and set
# the schedule. Every script in the ecosystem is listed here — from the
# orchestrators that run it all, down to the individual scripts you can run
# standalone for specific tasks.
#
# ==============================================================================================
# OPERATIONAL MODEL
# ==============================================================================================
#
# ── HOW THIS ECOSYSTEM WORKS ──────────────────────────────────────────────────────────────────
# When used as intended, only a handful of orchestrators need to be scheduled.
# The orchestrators handle everything else in the correct order — they call child scripts,
# manage timing and dependencies, track pass/fail, and send one notification per window.
# The orchestrators handle everything else in the correct order — they call child
# scripts, manage timing and dependencies, track pass/fail, and send one
# notification per window.
#
# You do not need to schedule every script below. The orchestrators cover it all:
#
# array_started.sh at array start — launches ALL startup scripts in order
# array_stopping.sh at array stop — graceful shutdown sequence
# watchdog_orchestrator.sh every 15 min — resource + docker + system watchdog
# transcode_management.sh every 7 min — cleanup then manager (order critical)
# critical_sync_maintenance.sh every 30 min — auth + Emby dirty sync + partnership
# intermediate_sync_maintenance.sh every 4 hours — arr library sync + artwork fetch
# daily_sync_maintenance.sh 1am daily — git + rsync + media + restart
# rsync.sh --profile=emby-fallback every 30 min — Emby watch state dirty sync
# weekly_sync_maintenance.sh 2:30am Sunday — clean sync + image updates
# sunday_morning_coffee_report.sh 7am Sunday — full weekly digest
# weekly_health_digest.sh 8am daily — profile-controlled health notification
# system_tuning_monitor.sh every 6 hours — inotify + php-fpm trend tracking
# monthly_maintenance.sh 15th monthly — uptime-gated heavy tasks (ZFS scrub, SMART long test)
# array_stopping.sh at array stop — graceful shutdown sequence
# watchdog_orchestrator.sh every 15 min — resource + docker + system watchdog
# transcode_management.sh every 7 min — cleanup then manager (order critical)
# critical_sync_maintenance.sh every 30 min — auth + play_state_sync + partnership
# intermediate_sync_maintenance.sh every 4 hours — arr library sync + artwork fetch
# daily_sync_maintenance.sh 1am daily — git + rsync + media + restart
# weekly_sync_maintenance.sh 2:30am Sunday — clean sync + image updates
# sunday_morning_coffee_report.sh 7am Sunday — full weekly digest
# weekly_health_digest.sh 8am daily — profile-controlled health notification
# system_tuning_monitor.sh every 6 hours — inotify + php-fpm trend tracking
# monthly_maintenance.sh 15th monthly — uptime-gated heavy tasks (ZFS scrub, SMART long test)
#
# ── INDIVIDUAL SCRIPTS ────────────────────────────────────────────────────────────────────────
# Every child script is also listed below, individually.
@@ -227,10 +233,9 @@
# Auth stack to HOST2: NPM proxy rules, TLS certs, LLDAP user accounts,
# Authelia config and policies. HOST2 auth always within 30min of HOST1.
#
# rsync Emby dirty sync:
# Watch states, user activity, library delta — Emby stays running on both sides.
# WAL/SHM files excluded (unsafe to copy mid-write). HOST2 Emby restarts after sync
# to pick up config changes.
# play_state_sync:
# API-based watch state and resume position sync. Runs as a CRITICAL_MAINTENANCE_SCRIPT
# in this window. No rsync — uses Emby API to sync per-user watch state directly.
#
# partnership --check:
# Reads remote state file. Increments offline counter on failed sync.
@@ -295,22 +300,6 @@
# bash /boot/config/plugins/varaverk/Orchestrators/daily_sync_maintenance.sh
# ── RSYNC EMBY FALLBACK ───────────────────────────────────────────────────────────────────────
# Schedule: */30 * * * * (every 30 minutes)
# Background: YES
#
# Keeps HOST2 Emby within 30 minutes of HOST1 on watch states and library changes.
# Direct rsync.sh call (not an orchestrator). Emby stays running on both sides.
#
# Syncs: users.db, library.db, authentication.db, config/
# Skips: *.wal *.shm (unsafe mid-write), transcodes/, logs/, cache/ (volatile/local only)
# After: HOST2 Emby restarts to pick up any config changes from the sync.
# Result: if HOST1 fails, users resume from at most 30 minutes stale.
#
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh \
# /mnt/user/Media_Server/Emby --profile=emby-fallback
# ── WEEKLY SYNC MAINTENANCE ───────────────────────────────────────────────────────────────────
# Schedule: 30 2 * * 0 (Sunday 2:30am — 4.5 hours before coffee report)
# Background: YES
@@ -524,7 +513,6 @@
# important-data Postgres-NextCloud + delayed: NextCloud
# arrs_stack Sonarr, Radarr, Lidarr, Prowlarr, Bazarr, Pinchflat
# emby Emby both sides (weekly clean sync — both instances stopped)
# emby-fallback nothing stopped (Emby stays running — dirty sync, WAL/SHM excluded)
# [no profile] no containers stopped (media shares, plain data)
#
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh \
@@ -536,8 +524,6 @@
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh \
# /mnt/user/Media_Server/Emby --profile=emby
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh \
# /mnt/user/Media_Server/Emby --profile=emby-fallback
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh \
# /mnt/user/appdata-Fallback/Gmer4Lfe
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh /mnt/user/Movies
# bash /boot/config/plugins/varaverk/Rsync/rsync.sh /mnt/user/Tv_Shows
@@ -1422,7 +1408,7 @@
#
# */30 * * * * every 30 minutes:
# Orchestrators/critical_sync_maintenance.sh
# Rsync/rsync.sh /mnt/user/Media_Server/Emby --profile=emby-fallback
# └─ Critical-Data rsync → play_state_sync → partnership --check
#
# 0 */4 * * * every 4 hours:
# Orchestrators/intermediate_sync_maintenance.sh