From a42294b706545dedc0609affc995710f98352a0c Mon Sep 17 00:00:00 2001 From: Houkime <> Date: Wed, 8 Feb 2023 15:40:45 +0000 Subject: [PATCH] feature(backup): add a restore function to restic backuper --- selfprivacy_api/backup/restic_backuper.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/selfprivacy_api/backup/restic_backuper.py b/selfprivacy_api/backup/restic_backuper.py index 5098e97..be17473 100644 --- a/selfprivacy_api/backup/restic_backuper.py +++ b/selfprivacy_api/backup/restic_backuper.py @@ -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)