mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-26 14:01:30 +00:00
feature(backup): add a restore function to restic backuper
This commit is contained in:
parent
3970524bce
commit
1568ee68a4
|
@ -69,3 +69,13 @@ class ResticBackuper(AbstractBackuper):
|
||||||
# stdout=log_file,
|
# stdout=log_file,
|
||||||
# stderr=subprocess.STDOUT,
|
# stderr=subprocess.STDOUT,
|
||||||
# )
|
# )
|
||||||
|
|
||||||
|
def restore_from_backup(self, repo_name, snapshot_id, folder):
|
||||||
|
"""
|
||||||
|
Restore from backup with restic
|
||||||
|
"""
|
||||||
|
restore_command = self.restic_command(
|
||||||
|
repo_name, "restore", snapshot_id, "--target", folder
|
||||||
|
)
|
||||||
|
|
||||||
|
subprocess.run(restore_command, shell=False)
|
||||||
|
|
Loading…
Reference in a new issue