summaryrefslogtreecommitdiff
path: root/lbup
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-10-08 12:21:27 +0200
committerAnton Khirnov <anton@khirnov.net>2023-10-08 12:21:27 +0200
commiteee2a77bcd6367c4bd64677b047a81a9de2ad848 (patch)
treed750c313690e90a8c9c74917e8864f7771c28ee9 /lbup
parent4ba0cdfb017988c3c19101780b1049480724193b (diff)
repository: do not write size stats on dry run
Diffstat (limited to 'lbup')
-rw-r--r--lbup/repository.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lbup/repository.py b/lbup/repository.py
index 6b7c54b..76ec1fd 100644
--- a/lbup/repository.py
+++ b/lbup/repository.py
@@ -113,8 +113,11 @@ class Repo:
backup_time = datetime.datetime.now(datetime.timezone.utc)
- with open(os.path.join(data_dir, self.sizestat_name), 'a') as f:
- f.write('%s %d\n' % (backup_time.isoformat(timespec = 'seconds'), size_post - size_pre))
+ if not dry_run:
+ with open(os.path.join(data_dir, self.sizestat_name), 'a') as f:
+ f.write('%s %d\n' %
+ (backup_time.isoformat(timespec = 'seconds'),
+ size_post - size_pre))
result.target_results[tgt.name] = res