From 4afe3f76a7a51f3a5e94dbdc1f734f8cb007ed35 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 9 Mar 2017 20:03:47 +0800 Subject: bin/dar_backup.py: Fix dry_run support --- bin/dar_backup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/dar_backup.py b/bin/dar_backup.py index 8a987a2..7165ecc 100755 --- a/bin/dar_backup.py +++ b/bin/dar_backup.py @@ -222,7 +222,7 @@ class DarBackup: self.args_create = settings.args_create self.args_test = settings.args_test - def run(self): + def run(self, dry_run=False): if self.is_system and (not self.is_running_as_root()): raise RuntimeError("Running as root to backup the system root") @@ -232,8 +232,9 @@ class DarBackup: else: self.backup_full() - self.test_backup() - self.isolate_catalog() + if not dry_run: + self.test_backup() + self.isolate_catalog() def backup_full(self): logger.info("Start full backup ...") @@ -307,7 +308,7 @@ def main(): settings = DarSettings(args.config, verbose=args.verbose, dry_run=args.dry_run) dar = DarBackup(settings) - dar.run() + dar.run(dry_run=args.dry_run) if __name__ == "__main__": -- cgit v1.2.2