added write back timing checks correlastes with tiers timing

This commit is contained in:
2026-04-19 15:45:15 -04:00
parent ed9e927c41
commit 4399c81b6e
5 changed files with 407 additions and 79 deletions
+21 -5
View File
@@ -2,9 +2,18 @@
# -----------------------------------------------------------------------------------------------
# --------------------------------- Daily Sync Orchestrator ------------------------------------
# -----------------------------------------------------------------------------------------------
# Runs all bulk media shares sequentially. Scheduled via unRAID User Scripts plugin at 1am.
# 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.
#
# HOST1 pushes: its truth shares (Movies, Tv_Shows, Music etc.) + personal → HOST2
# HOST2 pushes: its truth shares (Anime_Shows, Anime_Movies etc.) + personal → HOST1
#
# detect_hosts() determines which server is running the script at runtime.
# Share lists are configured per host in Master.conf — no script changes needed
# to add, remove, or reconfigure shares.
#
# Per-share rsync handled by rsync.sh — this script tracks pass/fail and total time only.
# Add or remove shares in Master.conf under DAILY_SYNC_SHARES.
# Scheduled via unRAID User Scripts plugin at 1am on both servers.
# -----------------------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -35,21 +44,28 @@ check_connectivity
check_remote_rootfs
# -----------------------------------------------------------------------------------------------
# Tracking
# Build share list — host-specific truth shares + personal shares
# Each server only syncs the shares it is source of truth for
# Personal shares appended after media shares
# -----------------------------------------------------------------------------------------------
PASS=()
FAIL=()
SHARE_TIMES=()
TOTAL_START=$(date +%s)
# Build combined share list — media shares + personal shares for this host
ALL_SHARES=("${DAILY_SYNC_SHARES[@]}")
ALL_SHARES=()
if [[ "$LOCAL_SERVER_NAME" == "$HOST1" ]]; then
for share in "${HOST1_DAILY_SYNC_SHARES[@]}"; do
[[ -n "$share" ]] && ALL_SHARES+=("$share")
done
for share in "${HOST1_PERSONAL_SHARES[@]}"; do
[[ -n "$share" ]] && ALL_SHARES+=("$share")
done
elif [[ "$LOCAL_SERVER_NAME" == "$HOST2" ]]; then
for share in "${HOST2_DAILY_SYNC_SHARES[@]}"; do
[[ -n "$share" ]] && ALL_SHARES+=("$share")
done
for share in "${HOST2_PERSONAL_SHARES[@]}"; do
[[ -n "$share" ]] && ALL_SHARES+=("$share")
done