added inotify script and updted downloader reset to match our standard

This commit is contained in:
2026-04-26 14:03:43 -04:00
parent 0f19913c52
commit e03c531159
5 changed files with 644 additions and 452 deletions
+64 -19
View File
@@ -163,7 +163,8 @@ ARRAY_START_SCRIPTS=(
"Transcodes/ramdisk_setup.sh" # creates ramdisk + symlink before Emby starts
"unRAID_Essentials/docker_syslog_filter.sh" # suppress veth noise before logs fill
"unRAID_Essentials/php_fpm_max_children.sh" # WebGUI performance tuning
# "Docker_Essentials/docker_network_connect.sh" # connect containers to extra networks
"unRAID_Essentials/inotify_tuning.sh" # bump inotify limits — containers miss events if exhausted
"Docker_Essentials/docker_network_connect.sh" # ensure networks exist + connect containers
"unRAID_Essentials/system_watchdog.sh" # system health monitor — continuous loop
"Docker_Essentials/docker_watchdog.sh" # container health monitor — continuous loop
# "Failover/failover.sh" # mutual failover — continuous loop
@@ -218,6 +219,22 @@ HOST2_PERSONAL_SHARES=(
# /mnt/user/Jayred365-Personal # uncomment after creating encrypted dataset
)
# ━━━ Media Management ━━━
# Job list run directly by daily_sync_maintenance.sh after the media share sync.
# Runs sequentially — permissions first, then cleaners, then arr cleanup.
# Comment out any job to disable without removing it.
# Each individual script can still be run manually for one-off maintenance.
MEDIA_MANAGEMENT_JOBS=(
"Media/media_shares_permissions.sh" # apply permissions — runs first
"Media/media_cleaner.sh anime" # remove junk from anime shares
"Media/media_cleaner.sh media" # remove junk from media shares
# "Media/lidarr_cleanup.sh" # remove orphaned music files
# "Media/sonarr_cleanup.sh" # remove orphaned TV files
# "Media/radarr_cleanup.sh" # remove orphaned movie files
"Docker_Essentials/downloaders_reset.sh" # clear stuck states + purge old history
)
# ━━━ Weekly Sync Maintenance ━━━
# weekly_sync_maintenance.sh handles the critical sync built into the script first:
# stop containers both sides → pull updates → sync Emby + Critical-Data → restart
@@ -244,21 +261,6 @@ WEEKLY_SYNC_JOBS=(
CRITICAL_SYNC_UPDATES=true # pull container updates locally
CRITICAL_SYNC_UPDATES_REMOTE=true # pull container updates on remote via SSH
# ━━━ Media Management ━━━
# Job list run directly by daily_sync_maintenance.sh after the media share sync.
# Runs sequentially — permissions first, then cleaners, then arr cleanup.
# Comment out any job to disable without removing it.
# Each individual script can still be run manually for one-off maintenance.
MEDIA_MANAGEMENT_JOBS=(
"Media/media_shares_permissions.sh" # apply permissions — runs first
"Media/media_cleaner.sh anime" # remove junk from anime shares
"Media/media_cleaner.sh media" # remove junk from media shares
# "Media/lidarr_cleanup.sh" # remove orphaned music files
# "Media/sonarr_cleanup.sh" # remove orphaned TV files
# "Media/radarr_cleanup.sh" # remove orphaned movie files
)
# ==============================================================================================
# ── RSYNC ─────────────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
@@ -592,6 +594,39 @@ FAILOVER_HOST2_WRITEBACK_TIER4=(
# ── DOCKER ESSENTIALS ─────────────────────────────────────────────────────────────────────────
# ==============================================================================================
# ━━━ Downloaders Reset ━━━
# Daily maintenance reset for all download clients.
# Called by daily_sync_maintenance.sh via MEDIA_MANAGEMENT_JOBS before container restarts.
# Clears stuck states, purges old history, prepares each downloader for a clean daily cycle.
#
# Retention period — applies to: slskd failed imports, SABnzbd completed and failed history
DOWNLOADER_RETENTION_DAYS=7
# ── slskd ──
# Clears stuck/errored searches, dead transfer records, purges expired failed imports
# SLSKD_FAILED_IMPORTS_DIR: where Soularr moves albums Lidarr rejected
HOST1_SLSKD_URL="http://localhost:8980"
HOST1_SLSKD_API_KEY="4bF9kL2mNpQrT7vWxYz1A3dEgHjKoRsU"
HOST1_SLSKD_FAILED_IMPORTS_DIR="/mnt/user/Temp_Storage/Slskd/completed/failed_imports"
# ── SABnzbd ──
# Clears completed history, failed history, and stalled paused queue items
HOST1_SABNZBD_URL="http://localhost:8180"
HOST1_SABNZBD_API_KEY="8bfefe41d83b4d50883e32859b55ca9a"
# ── qBittorrent ──
# Last chance failsafe — deletes torrents older than QBIT_FAILSAFE_MIN_DAYS
# qBittorrent's own rules handle normal cleanup (ratio >= 1.25 OR 45 days inactive)
# This catches anything missed after extended time
# deleteFiles=false — removes torrent from qBit but leaves files on disk
# Radarr/Sonarr manage actual files independently
# QBIT_FAILSAFE_MIN_RATIO=0 disables ratio gate — age is the only condition
HOST1_QBIT_URL="http://localhost:8080"
HOST1_QBIT_USERNAME="admin"
HOST1_QBIT_PASSWORD="changeme"
QBIT_FAILSAFE_MIN_DAYS=180
QBIT_FAILSAFE_MIN_RATIO=0 # 0 = age only, no ratio requirement
# ━━━ Docker Daily Restart ━━━
# Containers restarted every day by docker_daily_restart.sh via daily_sync_maintenance.sh.
# These containers run better with a daily restart — not just "keeping things fresh".
@@ -782,6 +817,16 @@ NETWORK_CONNECT_NETWORKS=(
# ── UNRAID ESSENTIALS ─────────────────────────────────────────────────────────────────────────
# ==============================================================================================
# ━━━ inotify Tuning ━━━
# Linux inotify limits — applied at every array start by inotify_tuning.sh
# Default unRAID values are very low — with many Docker containers watching files
# (Sonarr, Radarr, Lidarr, NextCloud etc.) you can silently exhaust the limit.
# Symptoms: containers miss file events, downloads not detected, library not updated.
# These settings are lost on reboot — reapplied automatically at array start.
INOTIFY_MAX_INSTANCES=512 # default: 128 — max inotify instances per user
INOTIFY_MAX_WATCHES=524288 # default: 8192 — max files watched per instance
INOTIFY_MAX_QUEUED_EVENTS=32768 # default: 16384 — max events queued before dropping
# ━━━ Reboot ━━━
# Seconds of warning broadcast to logged-in users before server_reboot.sh reboots.
# Gives users time to save work — 300s = 5 minutes
@@ -949,7 +994,7 @@ LIDARR_PROTECTED_PATTERNS=(
# NEVER deleted — cover art, metadata, lyrics
# Lidarr generates these but doesn't include them in trackFile API
# Without this protection cleanup would delete all your artwork
LIDARR_MAX_DELETE_GB=5 # require --i-know-what-im-doing if deletion exceeds this
LIDARR_MAX_DELETE_GB=1 # require --i-know-what-im-doing if deletion exceeds this
LIDARR_MIN_TRACKED_PCT=80 # abort if tracked count drops below this % of last run
# protects against API returning partial data on a bad day
LIDARR_TRACKED_COUNT_FILE="$DATA_DIR/lidarr_tracked.count"
@@ -980,7 +1025,7 @@ declare -A HOST2_SONARR_PATH_MAP=(
)
SONARR_ORPHAN_AGE=7 # days — files must be older than this before eligible for deletion
SONARR_MAX_DELETE_GB=10 # require --i-know-what-im-doing if deletion exceeds this
SONARR_MAX_DELETE_GB=1 # require --i-know-what-im-doing if deletion exceeds this
SONARR_EXTENSIONS=("mkv" "mp4" "avi" "m4v" "ts" "wmv" "mov")
SONARR_PROTECTED_PATTERNS=(
# Subtitles
@@ -1024,7 +1069,7 @@ declare -A HOST2_RADARR_PATH_MAP=(
)
RADARR_ORPHAN_AGE=7 # days — files must be older than this before eligible for deletion
RADARR_MAX_DELETE_GB=15 # require --i-know-what-im-doing if deletion exceeds this
RADARR_MAX_DELETE_GB=1 # require --i-know-what-im-doing if deletion exceeds this
RADARR_EXTENSIONS=("mkv" "mp4" "avi" "m4v" "wmv" "mov")
RADARR_PROTECTED_PATTERNS=(
# Subtitles