I’m looking for some advice/explanation of the proper restore procedure. I’m using this command on my Mac laptop:
restic -r s3:https://s3.amazonaws.com/my-bucket restore 3704db23 --target /Users/my-user-name/projects/my-project/folder/subfolder/My\ Photos --include /construction\ work/2009/01.12.09
The ideas is to restore
/construction\ work/2009/01.12.09 into
/Users/my-user-name/projects/my-project/folder/subfolder/My\ Photos folder, but no matter what folders I add into
--include or even if I use
--path "/my-path/my-file", the result is the same, the restored folder structure completely duplicates entire folder structure of the
--target parameter inside the target path, here’s the resulted folder structure:
/Users/my-user-name/projects/my-project/folder/subfolder/My\ Photos/Users/my-user-name/projects/my-project/folder/subfolder/My\ Photos/construction\ work/2009/01.12.09.
Does this happens because I didn’t escape the folder names properly (empty spacing, dots, etc?)
Any help or tips will be much appreciated.
To discover right restore target I do the following procedure:
restic ls 3704db23 to list files and structure in repo
--target is prefixed to structure shown with
restic ls 3704db23 shows files like
- I would like to restore to
--target /home/foobar must be specified
When your entire folder structure is duplicated, setting
--target / should do the trick.
Thank you for the tip and explanation, it does work.
Interesting observation. When I tried to use
restic ls 3704db23 to list all the folders/files in the snapshot it doesn’t show all the folder and files, some folders that are in the snapshot for some reason are not listed. Why is that?
I’d strongly suggest to simply restore the files to a temporary folder and move them to the correct place afterwards.
Currently, there’s no option to tell restore to only restore a subfolder. The
--include option only selects which parts of a folder structure should be restored, but that implicitly also includes all parent folders.
Add support for snapshot:path syntax by MichaelEischer · Pull Request #4334 · restic/restic · GitHub will add an option to only restore a specific subfolder.
That shouldn’t be possible. Did you check using mount/restore that this is indeed the case.
Sorry for the late reply, but that’s what I saw. No I didn’t do a restore there’s not enough space on the drive. And I’m not sure I know how to mount it on MacOS.