feat: Add batch runner and priority list
This commit is contained in:
1 parent
568795e364
commit
ec23bf6d2d
3 files changed
+304
No files matched your search
@@ -0,0 +1,96 @@
|
||||
# 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`.
|
||||
Reference in new issue
Block a user