diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-10-18 15:02:44 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-10-18 16:17:35 +0200 |
commit | 89a67fdb3fb28c88aaa0abdedbff080c06f78c4e (patch) | |
tree | 803bbcd75f3558e4bc60eb849220bc41042a8f64 /lbup/repository.py | |
parent | fbb0edad8fc713b10e8649444497ef67db37e9ad (diff) |
Add a dry-run option.
Diffstat (limited to 'lbup/repository.py')
-rw-r--r-- | lbup/repository.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lbup/repository.py b/lbup/repository.py index a0caf75..8275910 100644 --- a/lbup/repository.py +++ b/lbup/repository.py @@ -55,7 +55,7 @@ class Repo: self.bup_dir = bup_dir self.data_dir = data_dir - def backup(self, tgts, gen_par2 = True): + def backup(self, tgts, *, gen_par2 = True, dry_run = False): """ Backup the supplied targets. @@ -72,7 +72,7 @@ class Repo: for tgt in tgts: self._logger.info('Backing up %s...' % tgt.name) try: - res = tgt.save(self.data_dir) + res = tgt.save(self.data_dir, dry_run) except Exception as e: self._logger.exception('Exception backing up %s: %s' % (tgt.name, str(e))) res = StepResult(False, str(e).encode('utf-8')) |