97 lines
2.1 KiB
Markdown
97 lines
2.1 KiB
Markdown
# Batch runner for Generic Plex Salvage
|
|
|
|
Keep `batch.sh` in the same directory as:
|
|
|
|
```text
|
|
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`:
|
|
|
|
```text
|
|
# Family priority recovery list
|
|
/Media/TV/SEAL Team
|
|
/Media/TV/Doctor Who
|
|
/Media/Movies/Alien
|
|
/Media/Movies/Aliens
|
|
```
|
|
|
|
Run:
|
|
|
|
```bash
|
|
./batch.sh scan priority.txt
|
|
./batch.sh recover priority.txt
|
|
```
|
|
|
|
## Relative paths with a common base
|
|
|
|
Example `priority.txt`:
|
|
|
|
```text
|
|
TV/SEAL Team
|
|
TV/Doctor Who
|
|
Movies/Alien
|
|
Movies/Aliens
|
|
```
|
|
|
|
Run:
|
|
|
|
```bash
|
|
./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:
|
|
|
|
```text
|
|
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.
|
|
|
|
## Recommended workflow
|
|
|
|
Scan the whole priority list first:
|
|
|
|
```bash
|
|
./batch.sh scan priority.txt --base '/Media'
|
|
```
|
|
|
|
Review the resulting per-folder summaries and available recovery-disk space,
|
|
then recover the same list:
|
|
|
|
```bash
|
|
./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`.
|