I have two external HDDs whose contents are synchronized from time to time “in the field”. So they are always slightly different, but almost the same. If one of them comes to my office, I would like to backup the contents into the repo.
So that --parent works and not all file contents have to be read again, I always have to manually mount the source files on the same absolute moutpoint. Using the automatic mounting (/media/ on Linux or /Volumes/ on MacOS) then the HDDs must have the same volume label, which makes trouble with direct syncing between the HDDs.
It would be convenient not only in this case, if you could also specify the relative path instead of the absolute path.
Backup solution proposal:
restic -r <repo> -p <pwdfile> backup /Volumes/marjorie02 --relative-path
should overwrite the saved snapshot path from
But I’m overall not sure if that would make sense because the host name and path are used to uniquely identify backups in the snapshot list. It could also interfere with the automatic parent search. I think it would make sense to allow only the usage of relative paths for the manually selection of parent snapshots:
restic -r <repo> -p <pwdfile> backup /Volumes/marjorie02 --relative-parent <snapshot>
In this case, a parent snapshot with any path would work with the backup data, because it would both be treated as if it were under the same path.
When restoring it should be possible too to use relative paths (not just because of the parent snapshot, but in general. It occurred to me now that this is a bigger topic. Would be worth a thread of its own?)
Restore solution proposal:
restic -r <repo> -p <pwdfile> restore <snapshot> /Volumes/marjorie01/ --relative-path
should cut off
/Volumes/marjorie02 and restore only the path below into
/Volumes/marjorie01/. That would be possible in any case, because only the absolute path before the top backup data directory has to be cut-off.
I think it is important to introduce this option in some way. It is extremely annoying that the absolute path is always used when restoring. If the path to the backup data is “endless”, it is uselessly mounted or restored exactly that way, instead of using the real top of the backup files.
What do you think?