From 6e04eb490fc4119bf4712a059da23003421fdcba Mon Sep 17 00:00:00 2001 From: yodax Date: Mon, 3 Apr 2017 14:30:42 +0200 Subject: [PATCH] Add check to prevent division by zero during backup status --- management/backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/management/backup.py b/management/backup.py index d6189cfe..2021ddee 100755 --- a/management/backup.py +++ b/management/backup.py @@ -115,7 +115,7 @@ def backup_status(env): # full backup. That full backup frees up this one to be deleted. But, the backup # must also be at least min_age_in_days old too. deleted_in = None - if incremental_count > 0 and first_full_size is not None: + if incremental_count > 0 and incremental_size > 0 and first_full_size is not None: # How many days until the next incremental backup? First, the part of # the algorithm based on increment sizes: est_days_to_next_full = (.5 * first_full_size - incremental_size) / (incremental_size/incremental_count)