From e7062d72c602cfb3316b8f189e34a0d0d19918f8 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)