From e069eb9940dcad809a19d8ab9d578d889c5eff37 Mon Sep 17 00:00:00 2001 From: Michael Kroes Date: Sat, 16 Jul 2016 11:25:39 +0200 Subject: [PATCH] Add trailing slash when checking a remote backup. Also check if we actually can read the remote size --- management/backup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/management/backup.py b/management/backup.py index c69b1b5b..0e35b4e5 100755 --- a/management/backup.py +++ b/management/backup.py @@ -101,7 +101,7 @@ def backup_status(env): # onto. Round up since the backup occurs on the night following # when the threshold is met. deleted_in = None - if incremental_count > 0 and first_full_size is not None: + if incremental_count > 0 and first_full_size is not None and incremental_size > 0: deleted_in = "approx. %d days" % round(config["min_age_in_days"] + (.5 * first_full_size - incremental_size) / (incremental_size/incremental_count) + .5) # When will a backup be deleted? @@ -369,6 +369,8 @@ def list_target_files(config): _, target_host, target_path = config['target'].split('//') target_path = '/' + target_path + if not target_path.endswith('/'): + target_path += '/' rsync_command = [ 'rsync', '-e',