aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-03-09 20:03:47 +0800
committerAaron LI <aaronly.me@outlook.com>2017-03-09 20:03:47 +0800
commit4afe3f76a7a51f3a5e94dbdc1f734f8cb007ed35 (patch)
tree65f38b28411ef3c9f7b8e184c6a5330a03bff5b4 /bin
parent56641bc0d6a13785b3c89f218c1ea3f20a8435ca (diff)
downloadatoolbox-4afe3f76a7a51f3a5e94dbdc1f734f8cb007ed35.tar.bz2
bin/dar_backup.py: Fix dry_run support
Diffstat (limited to 'bin')
-rwxr-xr-xbin/dar_backup.py9
1 files 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__":