From 923e1ea470c6bfe1b620a52332f5ed936178b8ae Mon Sep 17 00:00:00 2001 From: usmannasir Date: Tue, 8 Oct 2024 20:12:06 +0500 Subject: [PATCH] bug fix to incremental backups --- IncBackups/IncBackupsControl.py | 7 ++++++- plogical/IncScheduler.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/IncBackups/IncBackupsControl.py b/IncBackups/IncBackupsControl.py index a3e324f14..e147873ad 100644 --- a/IncBackups/IncBackupsControl.py +++ b/IncBackups/IncBackupsControl.py @@ -138,7 +138,7 @@ class IncJobs(multi.Thread): backupExcludesFile = '/home/%s/backup-exclude.conf' % (self.website.domain) resticBackupExcludeCMD = ' --exclude-file=%s' % (backupExcludesFile) - command = 'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s --exclude /home/%s/backup --exclude /home/%s/incbackup' % ( + command = f'AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s --exclude /home/{self.website.domain}/logs --exclude /home/%s/backup --exclude /home/%s/incbackup' % ( key, secret, self.website.domain, backupPath, self.passwordFile, self.website.domain, self.website.domain) # If /home/%s/backup-exclude.conf file exists lets pass this to restic by appending the command to end. @@ -152,6 +152,11 @@ class IncJobs(multi.Thread): snapShotid = result.split(' ')[-2] + if os.path.exists(ProcessUtilities.debugPath): + logging.writeToFile(f'Snapshot id {snapShotid} from result {result}.') + + + if bType == 'database': newSnapshot = JobSnapshots(job=self.jobid, type='%s:%s' % (bType, backupPath.split('/')[-1].rstrip('.sql')), diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 66990fcac..1ee4a8f8f 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -448,6 +448,7 @@ class IncScheduler(multi.Thread): logging.writeToFile(f'Retention time {timerrtention}') except: print(f'Retention time not defined.') + timerrtention = '6m' if (timerrtention == '1d'): new = CUrrenttimestamp - float(86400)