bug fix to incremental backups

This commit is contained in:
usmannasir 2024-10-08 20:12:06 +05:00
parent c47e42bc07
commit 923e1ea470
2 changed files with 7 additions and 1 deletions

View File

@ -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')),

View File

@ -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)