feature(backup): add a restore function to restic backuper

pull/35/head
Houkime 2023-02-08 15:40:45 +00:00 committed by Inex Code
parent a0a0e1fb3b
commit a42294b706
1 changed files with 10 additions and 0 deletions

View File

@ -69,3 +69,13 @@ class ResticBackuper(AbstractBackuper):
# stdout=log_file,
# 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)