From c430806537d1f9b7b491c0a1cb23fc95a7057ff5 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 9 May 2021 13:48:15 +0500 Subject: [PATCH] bug fix: incremental backups delete --- IncBackups/IncBackupsControl.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/IncBackups/IncBackupsControl.py b/IncBackups/IncBackupsControl.py index f6214e77d..cffee30c2 100644 --- a/IncBackups/IncBackupsControl.py +++ b/IncBackups/IncBackupsControl.py @@ -197,7 +197,9 @@ class IncJobs(multi.Thread): result = ProcessUtilities.outputExecutioner(command) - if result.find('removed snapshot') == -1 or result.find('deleted') == -1: + if result.find('removed snapshot') > -1 or result.find('deleted') > -1: + pass + else: logging.statusWriter(self.statusPath, 'Failed: %s. [5009]' % (result), 1) return 0 @@ -265,7 +267,9 @@ class IncJobs(multi.Thread): command = 'restic -r %s forget %s --password-file %s' % (repoLocation, self.jobid.snapshotid, self.passwordFile) result = ProcessUtilities.outputExecutioner(command) - if result.find('removed snapshot') == -1 or result.find('deleted') == -1: + if result.find('removed snapshot') > -1 or result.find('deleted') > -1: + pass + else: logging.statusWriter(self.statusPath, 'Failed: %s. [5009]' % (result), 1) return 0 @@ -322,7 +326,10 @@ class IncJobs(multi.Thread): command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s forget %s --password-file %s' % ( self.jobid.destination, repoLocation, self.jobid.snapshotid, self.passwordFile) result = ProcessUtilities.outputExecutioner(command) - if result.find('removed snapshot') == -1 or result.find('deleted') == -1: + + if result.find('removed snapshot') > -1 or result.find('deleted') > -1: + pass + else: logging.statusWriter(self.statusPath, 'Failed: %s. [5009]' % (result), 1) return 0