I see some inconsistent behavior, at least in my opinion when restic repository are moved around, and we use relative paths to restore the backups.
Here is a test.
I ~/test_restic ❱ mkdir repo src restore I ~/test_restic ❱ echo test > pass I ~/test_restic ❱ restic -r ./repo init -p ./pass created restic repository 78040fd969 at ./repo Please note that knowledge of your password is required to access the repository. Losing your password means that your data is irrecoverably lost. I ~/test_restic 2.8s ❱ restic -r ./repo -p ./pass backup ./src repository 78040fd9 opened successfully, password is correct created new cache in /home/babu/.cache/restic no parent snapshot found, will read all files Files: 0 new, 0 changed, 0 unmodified Dirs: 1 new, 0 changed, 0 unmodified Added to the repo: 400 B processed 0 files, 0 B in 0:00 snapshot e99833a4 saved I ~/test_restic ❱ restic -r ./repo -p ./pass restore latest --path ./src -t restore/ repository 78040fd9 opened successfully, password is correct restoring <Snapshot e99833a4 of [/home/babu/test_restic/src] at 2022-01-14 15:07:51.626207528 -0800 PST by babu@babu> to restore/
So far so good. However, let’s see what happens when we move the repository to a different location and try to restore.
I ~/test_restic ❱ mkdir subdir I ~/test_restic ❱ mv repo subdir I ~/test_restic ❱ cd subdir I ~/t/subdir ❱ mkdir restore I ~/t/subdir ❱ restic -r ./repo -p ../pass restore latest --path ./src -t restore/ repository 78040fd9 opened successfully, password is correct latest snapshot for criteria not found: no snapshot found Paths:[./src] Hosts:
Upon further investigation, if the current directory from which the restore command is executed changes (different from where the backup command was executed), restore does not work anymore with relative paths.
This behavior seems inconsistent to me, at least when we compare to tools like tar. Is this the expected behavior? Thanks!