fixed reADME AND USER SCRIPT PLUGIN

This commit is contained in:
2026-04-19 12:12:49 -04:00
parent 14cc192a1f
commit 2ee3d607fb
4 changed files with 344 additions and 254 deletions
+39 -2
View File
@@ -21,6 +21,42 @@ Orchestrators solve this by making a set of related scripts into a single schedu
## Scripts
### `transcode_management.sh`
Runs `transcode_cleanup.sh` then `transcode_manager.sh` in the correct order every 3 minutes. Replaces two separate cron entries with one.
```bash
# Scheduled as: */3 * * * *
/mnt/user/appdata/unraid_scripts/Orchestrators/transcode_management.sh
```
**Why cleanup must run before manager:**
If the manager runs first it may see inflated ramdisk usage from stale segment files left by ended sessions — and trigger an unnecessary flip to SSD. Cleanup runs first to clear those files, then the manager makes its threshold decision based on real active session usage.
```
Without correct order:
Manager checks usage → 6.8GB (includes stale files) → flips to SSD
Cleanup runs → removes stale files → actual usage 2.1GB
Manager was wrong — unnecessary flip
With correct order:
Cleanup runs → removes stale files → actual usage 2.1GB
Manager checks usage → 2.1GB → stays on ramdisk ✅
```
**Daily statistics tracking:**
Every cycle `transcode_management.sh` records stats to `/boot/config/transcode_daily.db`:
- Peak ramdisk usage for the day
- Total flip count for the day
- Ramdisk vs SSD session counts
- Files cleaned
`weekly_health_digest.sh` reads this log for the weekly transcode summary. The log is bounded to `TRANSCODE_LOG_RETENTION` days — auto-purges on every write.
---
### `daily_sync.sh`
Syncs all bulk media shares to the remote server sequentially. Scheduled once daily.
@@ -177,8 +213,9 @@ This pattern means:
```bash
# Recommended schedule
0 1 * * * daily_sync.sh # 1am — media shares to remote
0 2 * * * media_management.sh # 2am — after sync completes
*/3 * * * * transcode_management.sh # cleanup then manager — every 3 minutes
0 1 * * * daily_sync.sh # 1am — media shares to remote
0 2 * * * media_management.sh # 2am — after sync completes
```
The 1 hour gap between them is intentional. `daily_sync.sh` can take 30-60 minutes on a large library. Starting `media_management.sh` before it finishes risks permission and cleanup operations running on files that are mid-transfer.