From 2467183a688ad0a41e4df418288ae7587db81e4a Mon Sep 17 00:00:00 2001 From: FailedProxy Date: Tue, 21 Apr 2026 19:46:04 -0400 Subject: [PATCH] orch naming restructure with the scripts --- Orchestrators/README-Orchestrators.md | 20 +++++++++---------- ...l_sync.sh => critical_shares_full_sync.sh} | 10 +++++----- .../{daily_sync.sh => media_shares_sync.sh} | 2 +- user_script_plug-in.sh | 20 +++++++++---------- 4 files changed, 26 insertions(+), 26 deletions(-) rename Orchestrators/{nightly_critical_full_sync.sh => critical_shares_full_sync.sh} (93%) rename Orchestrators/{daily_sync.sh => media_shares_sync.sh} (98%) diff --git a/Orchestrators/README-Orchestrators.md b/Orchestrators/README-Orchestrators.md index ab7f880..f88821a 100644 --- a/Orchestrators/README-Orchestrators.md +++ b/Orchestrators/README-Orchestrators.md @@ -57,22 +57,22 @@ Every cycle `transcode_management.sh` records stats to `/boot/config/transcode_d --- -### `daily_sync.sh` +### `media_shares_sync.sh` Syncs each server's source-of-truth media shares to the remote server sequentially. Each server only pushes the shares it owns — direction and share list are automatic based on which server is running the script. ```bash # Scheduled as: 0 1 * * * (1am daily — on both servers) -/mnt/user/appdata/unraid_scripts/Orchestrators/daily_sync.sh +/mnt/user/appdata/unraid_scripts/Orchestrators/media_shares_sync.sh ``` **Bidirectional — same script, correct direction automatically:** ``` -HOST1 runs daily_sync.sh → pushes HOST1_DAILY_SYNC_SHARES → TO HOST2 +HOST1 runs media_shares_sync.sh → pushes HOST1_DAILY_SYNC_SHARES → TO HOST2 Movies, Tv_Shows, Music, Books etc. — HOST1 is source of truth -HOST2 runs daily_sync.sh → pushes HOST2_DAILY_SYNC_SHARES → TO HOST1 +HOST2 runs media_shares_sync.sh → pushes HOST2_DAILY_SYNC_SHARES → TO HOST1 Anime_Shows, Anime_Movies — HOST2 is source of truth ``` @@ -135,13 +135,13 @@ The same share lists are used by `failover.sh` for Tier 4 writeback — but in t --- -### `nightly_critical_full_sync.sh` +### `critical_shares_full_sync.sh` Runs a clean nightly sync for Emby and the auth stack (Critical-Data) with containers stopped. This is the companion to the hourly dirty sync — it provides a fully consistent state on HOST2 once per night. ```bash # Scheduled as: 30 2 * * 0 (2:30am Sunday — weekly clean sync) -/mnt/user/appdata/unraid_scripts/Orchestrators/nightly_critical_full_sync.sh +/mnt/user/appdata/unraid_scripts/Orchestrators/critical_shares_full_sync.sh ``` **Why two Emby syncs:** @@ -202,7 +202,7 @@ Auth: logs, *.tmp, nginx/temp, nginx/cache, notification.txt Runs all media maintenance scripts sequentially in the order defined in `Master.conf`. Scheduled once daily, typically after the nightly sync. ```bash -# Scheduled as: 0 2 * * * (2am daily — after daily_sync.sh) +# Scheduled as: 0 2 * * * (2am daily — after media_shares_sync.sh) /mnt/user/appdata/unraid_scripts/Orchestrators/media_management.sh ``` @@ -301,12 +301,12 @@ This pattern means: ```bash # Recommended schedule */3 * * * * transcode_management.sh # cleanup then manager — every 3 minutes -0 1 * * * daily_sync.sh # 1am — media shares to remote +0 1 * * * media_shares_sync.sh # 1am — media shares to remote 0 2 * * * media_management.sh # 2am — permissions, cleaners, arr cleanup -30 2 * * 0 nightly_critical_full_sync.sh # 2:30am Sunday — clean Emby + auth stack +30 2 * * 0 critical_shares_full_sync.sh # 2:30am Sunday — clean Emby + auth stack ``` -`daily_sync.sh` and `media_management.sh` run nightly — media shares and maintenance. `nightly_critical_full_sync.sh` runs weekly on Sunday — it stops Emby and the auth stack for a clean consistent sync. Running it weekly instead of nightly lets Emby's image cache stay warm on HOST2 throughout the week. The emby-failover dirty sync handles watch states, library structure, and auth every 30-60 minutes — the weekly clean sync covers metadata, plugins, and a full database flush. +`media_shares_sync.sh` and `media_management.sh` run nightly — media shares and maintenance. `critical_shares_full_sync.sh` runs weekly on Sunday — it stops Emby and the auth stack for a clean consistent sync. Running it weekly instead of nightly lets Emby's image cache stay warm on HOST2 throughout the week. The emby-failover dirty sync handles watch states, library structure, and auth every 30-60 minutes — the weekly clean sync covers metadata, plugins, and a full database flush. --- diff --git a/Orchestrators/nightly_critical_full_sync.sh b/Orchestrators/critical_shares_full_sync.sh similarity index 93% rename from Orchestrators/nightly_critical_full_sync.sh rename to Orchestrators/critical_shares_full_sync.sh index 17cae43..f51c89f 100644 --- a/Orchestrators/nightly_critical_full_sync.sh +++ b/Orchestrators/critical_shares_full_sync.sh @@ -1,12 +1,12 @@ #!/bin/bash # ----------------------------------------------------------------------------------------------- -# --------------------------------- Nightly Critical Full Sync Orchestrator ---------------------------------- +# --------------------------------- Critical Shares Full Sync ---------------------------------- # ----------------------------------------------------------------------------------------------- # Runs clean nightly sync for Emby and the auth stack (Critical-Data). # Both require containers stopped for a consistent, safe state sync. # -# Why this exists as a separate orchestrator from daily_sync.sh: -# daily_sync.sh handles media shares — large, runs at 1am, no container stops needed +# Why this exists as a separate orchestrator from media_shares_sync.sh: +# media_shares_sync.sh handles media shares — large, runs at 1am, no container stops needed # This script handles appdata that needs containers stopped for clean state: # # Emby: @@ -21,7 +21,7 @@ # Users, groups, proxy rules, SSL certs all consistent # Adding a user on HOST1 → propagates to HOST2 overnight automatically # -# Schedule: 2:30am daily — after daily_sync.sh (1am) finishes +# Schedule: 2:30am daily — after media_shares_sync.sh (1am) finishes # Container stop time is brief — Emby ~30s, auth stack ~15s # Users experience a short Emby interruption at 2:30am — acceptable tradeoff # @@ -77,7 +77,7 @@ SHARE_TIMES=() TOTAL_START=$(date +%s) SYNC_JOBS=( - "/mnt/user/appdata-Failover/Emby" + "/mnt/user/Media_Server/Emby" "/mnt/user/appdata-Failover/Critical-Data" ) diff --git a/Orchestrators/daily_sync.sh b/Orchestrators/media_shares_sync.sh similarity index 98% rename from Orchestrators/daily_sync.sh rename to Orchestrators/media_shares_sync.sh index bc0ce17..3ed4f3d 100644 --- a/Orchestrators/daily_sync.sh +++ b/Orchestrators/media_shares_sync.sh @@ -1,6 +1,6 @@ #!/bin/bash # ----------------------------------------------------------------------------------------------- -# --------------------------------- Daily Sync Orchestrator ------------------------------------ +# --------------------------------- Media Shares Sync ------------------------------------ # ----------------------------------------------------------------------------------------------- # Runs all media shares sequentially in the correct direction for the local server. # Each server pushes its own source-of-truth shares to the remote — direction is automatic. diff --git a/user_script_plug-in.sh b/user_script_plug-in.sh index c989fa5..ee999e5 100644 --- a/user_script_plug-in.sh +++ b/user_script_plug-in.sh @@ -65,8 +65,8 @@ # │ └── README-Monitors.md # │ # ├── Orchestrators/ -# │ ├── daily_sync.sh # Runs all daily media share syncs sequentially -# │ ├── nightly_critical_full_sync.sh # Clean nightly sync — Emby + auth stack stopped +# │ ├── media_shares_sync.sh # Runs all daily media share syncs sequentially +# │ ├── critical_shares_full_sync.sh # Clean nightly sync — Emby + auth stack stopped # │ ├── media_management.sh # Runs permissions + cleaners + arr cleanup # │ ├── transcode_management.sh # Runs cleanup then manager every 3min + daily stats # │ └── README-Orchestrators.md @@ -163,8 +163,8 @@ # Orchestrators run their child scripts in the correct order. # Individual scripts below are still accessible for manual runs or testing. # -#/mnt/user/appdata/unraid_scripts/Orchestrators/daily_sync.sh -#/mnt/user/appdata/unraid_scripts/Orchestrators/nightly_critical_full_sync.sh +#/mnt/user/appdata/unraid_scripts/Orchestrators/media_shares_sync.sh +#/mnt/user/appdata/unraid_scripts/Orchestrators/critical_shares_full_sync.sh #/mnt/user/appdata/unraid_scripts/Orchestrators/media_management.sh #/mnt/user/appdata/unraid_scripts/Orchestrators/transcode_management.sh # @@ -175,7 +175,7 @@ #/mnt/user/appdata/unraid_scripts/Rsync/rsync.sh /mnt/user/Media_Server/Emby --profile=emby-failover # ^^ schedule every 30-60min — dirty sync, Emby running, critical data only #/mnt/user/appdata/unraid_scripts/Rsync/rsync.sh /mnt/user/Media_Server/Emby -# ^^ do NOT schedule — called by nightly_critical_full_sync.sh weekly Sunday 2:30am only +# ^^ do NOT schedule — called by critical_shares_full_sync.sh weekly Sunday 2:30am only #/mnt/user/appdata/unraid_scripts/Rsync/rsync.sh /mnt/user/appdata-Failover/Gmer4Lfe # # ━━━ Rsync — Individual Media Shares (ad hoc) ━━━ @@ -298,22 +298,22 @@ # */15 * * * * system_watchdog.sh # # ━━━ Daily ━━━ -# 0 1 * * * daily_sync.sh (media shares both directions) +# 0 1 * * * media_shares_sync.sh (media shares both directions) # 0 2 * * * media_management.sh (permissions + cleaners + arrs) -# 30 2 * * 0 nightly_critical_full_sync.sh (clean Emby + auth stack sync) +# 30 2 * * 0 critical_shares_full_sync.sh (clean Emby + auth stack sync) # 0 3 * * * docker_daily_restart.sh # 0 8 * * * weekly_health_digest.sh (profile controls if it sends) # # ━━━ Rsync profiles — schedule individually ━━━ # Arrs_Stack — daily or every few days (arr databases change on every download) -# Critical-Data — handled by nightly_critical_full_sync.sh — no separate schedule needed +# Critical-Data — handled by critical_shares_full_sync.sh — no separate schedule needed # Important-Data — daily (NextCloud file changes) # Gmer4Lfe — daily or weekly (personal appdata, rarely changes) -# Emby — handled by nightly_critical_full_sync.sh — no separate schedule needed +# Emby — handled by critical_shares_full_sync.sh — no separate schedule needed # emby-failover — every 30-60min via frequent cron above # # ━━━ Weekly — Sunday morning block ━━━ -# 30 2 * * 0 nightly_critical_full_sync.sh (clean Emby + auth stack — cache resets weekly) +# 30 2 * * 0 critical_shares_full_sync.sh (clean Emby + auth stack — cache resets weekly) # 0 3 * * 0 docker_weekly_restart.sh # 0 5 * * 0 clear_logs.sh # 0 6 * * 0 zfs_memory_snapshot.sh