mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-12 01:23:49 +00:00
fix(backups): actually mount if asked for an inplace restore
This commit is contained in:
parent
65ce86f0f9
commit
cacbf8335d
1 changed files with 9 additions and 2 deletions
|
@ -219,9 +219,16 @@ class ResticBackupper(AbstractBackupper):
|
||||||
raise ValueError("cannot restore without knowing where to!")
|
raise ValueError("cannot restore without knowing where to!")
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as dir:
|
with tempfile.TemporaryDirectory() as dir:
|
||||||
self.do_restore(snapshot_id, target=dir, verify=verify)
|
if verify:
|
||||||
|
self.do_restore(snapshot_id, target=dir, verify=verify)
|
||||||
|
snapshot_root = dir
|
||||||
|
else: # attempting inplace restore via mount + sync
|
||||||
|
self.mount_repo(dir)
|
||||||
|
snapshot_root = join(dir, "ids", snapshot_id)
|
||||||
|
|
||||||
|
assert snapshot_root is not None
|
||||||
for folder in folders:
|
for folder in folders:
|
||||||
src = join(dir, folder.strip("/"))
|
src = join(snapshot_root, folder.strip("/"))
|
||||||
if not exists(src):
|
if not exists(src):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"there is no such path: {src}. We tried to find {folder}"
|
f"there is no such path: {src}. We tried to find {folder}"
|
||||||
|
|
Loading…
Add table
Reference in a new issue