restic: restore a single kept file, not only a directory #56

Merged
jschoubben merged 1 commits from fix/restore-a-file into main 2026-10-05 12:22:18 +00:00
Owner

Found restoring sonarr on the home server through ace/node-backup.restore: path var/lib/sonarr/config/config.xml: not a directory. restic restore <id>:<path> takes a subfolder; the arr apps are the first modules to keep a single file (their settings).

  • A kept path is looked up in the snapshot (restic ls --json). A directory restores as before; a file restores with --include into <target>.partial, is moved to <path>.restored-<date>, and the scratch directory is removed. Still never over the live file.
  • The real-restic test now keeps a single file too, overwrites it by mistake, restores it beside the live one and checks no scratch remains. It fails on the old code.

The two directories that failed restore did restore — sonarr's database copy byte-identical, its 11 656 cover files without a difference — and were removed after checking. 9/9 pass.

Found restoring sonarr on the home server through `ace/node-backup.restore`: `path var/lib/sonarr/config/config.xml: not a directory`. `restic restore <id>:<path>` takes a subfolder; the arr apps are the first modules to keep a single file (their settings). - A kept path is looked up in the snapshot (`restic ls --json`). A directory restores as before; a file restores with `--include` into `<target>.partial`, is moved to `<path>.restored-<date>`, and the scratch directory is removed. Still never over the live file. - The real-restic test now keeps a single file too, overwrites it by mistake, restores it beside the live one and checks no scratch remains. It fails on the old code. The two directories that failed restore did restore — sonarr's database copy byte-identical, its 11 656 cover files without a difference — and were removed after checking. 9/9 pass.
jschoubben added 1 commit 2026-10-05 12:05:54 +00:00
The first restore of an arr app refused its settings file with "not a directory": restic restores
a snapshot's subfolder, not a file. A file is restored with its full path into a scratch directory
beside the target, moved into place, and the scratch removed.
jschoubben merged commit 83bd2afe66 into main 2026-10-05 12:22:18 +00:00
jschoubben deleted branch fix/restore-a-file 2026-10-05 12:22:18 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#56