diff --git a/backupbot.py b/backupbot.py index 88534b2..d567ff5 100755 --- a/backupbot.py +++ b/backupbot.py @@ -138,6 +138,15 @@ def restore(snapshot, target, noninteractive): logger.debug(result) +def restic_restore(snapshot_id='latest', include=[], target_dir=None): + cmd = restic.cat.base_command() + ['restore', snapshot_id] + for path in include: + cmd.extend(['--include', path]) + if target_dir: + cmd.extend(['--target', target_dir]) + return restic.internal.command_executor.execute(cmd) + + def get_snapshots(snapshot_id=None, app=None): if snapshot_id and snapshot_id != 'latest': snapshots = restic.snapshots(snapshot_id=snapshot_id)