Files
LVM-Recovery-09.2026/README-batch.md
T

2.1 KiB

Batch runner for Generic Plex Salvage

Keep batch.sh in the same directory as:

scan.sh
recover.sh
salvage.py

The batch runner reads one folder per line and calls the existing generic scanner or recovery script for each item.

Absolute paths

Example priority.txt:

# Family priority recovery list
/Media/TV/SEAL Team
/Media/TV/Doctor Who
/Media/Movies/Alien
/Media/Movies/Aliens

Run:

./batch.sh scan priority.txt
./batch.sh recover priority.txt

Relative paths with a common base

Example priority.txt:

TV/SEAL Team
TV/Doctor Who
Movies/Alien
Movies/Aliens

Run:

./batch.sh scan priority.txt --base '/Media'
./batch.sh recover priority.txt --base '/Media'

Behaviour

  • blank lines are ignored;
  • lines beginning with # are comments;
  • Windows CRLF text files are accepted;
  • leading/trailing whitespace is removed;
  • duplicate resolved paths are skipped;
  • spaces in folder names are handled;
  • folders are processed sequentially;
  • one failed or metadata-dead folder does not stop later items;
  • the batch exits nonzero after finishing if any requested folder failed.

The underlying scan.sh / recover.sh safety rules are unchanged. Recovery still processes only files classified SAFE.

Logging

When /mnt/recovery is writable, batch logs and summaries are written there:

batch-scan-priority-YYYYMMDD-HHMMSS.log
batch-scan-priority-YYYYMMDD-HHMMSS-summary.txt
batch-recover-priority-YYYYMMDD-HHMMSS.log
batch-recover-priority-YYYYMMDD-HHMMSS-summary.txt

Each source folder still gets its own normal manifest, scan summary, recovery TSV, and recovery summary from the generic salvage scripts.

Scan the whole priority list first:

./batch.sh scan priority.txt --base '/Media'

Review the resulting per-folder summaries and available recovery-disk space, then recover the same list:

./batch.sh recover priority.txt --base '/Media'

Recovery is restartable. Existing destination files whose sizes already match their source inode are skipped by recover.sh.