diff --git a/IncBackups/IncBackupsControl.py b/IncBackups/IncBackupsControl.py index cffee30c2..d7adc34dc 100644 --- a/IncBackups/IncBackupsControl.py +++ b/IncBackups/IncBackupsControl.py @@ -146,8 +146,8 @@ class IncJobs(multi.Thread): backupExcludesFile = '/home/%s/backup-exclude.conf' % (self.website.domain) resticBackupExcludeCMD = ' --exclude-file=%s' % (backupExcludesFile) - command = 'export AWS_ACCESS_KEY_ID=%s AWS_SECRET_ACCESS_KEY=%s && restic -r s3:s3.amazonaws.com/%s backup %s --password-file %s' % ( - key, secret, self.website.domain, backupPath, self.passwordFile) + command = 'export 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' % ( + 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. if os.path.isfile(backupExcludesFile): @@ -237,8 +237,8 @@ class IncJobs(multi.Thread): backupExcludesFile = '/home/%s/backup-exclude.conf' % (self.website.domain) resticBackupExcludeCMD = ' --exclude-file=%s' % (backupExcludesFile) - command = 'restic -r %s backup %s --password-file %s --exclude %s' % ( - self.repoPath, backupPath, self.passwordFile, self.repoPath) + command = 'restic -r %s backup %s --password-file %s --exclude %s --exclude /home/%s/backup' % ( + self.repoPath, backupPath, self.passwordFile, self.repoPath, self.website.domain) # If /home/%s/backup-exclude.conf file exists lets pass this to restic by appending the command to end. if os.path.isfile(backupExcludesFile): command = command + resticBackupExcludeCMD @@ -298,8 +298,8 @@ class IncJobs(multi.Thread): backupExcludesFile = '/home/%s/backup-exclude.conf' % (self.website.domain) resticBackupExcludeCMD = ' --exclude-file=%s' % (backupExcludesFile) remotePath = '/home/backup/%s' % (self.website.domain) - command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s backup %s --password-file %s --exclude %s' % ( - self.backupDestinations, remotePath, backupPath, self.passwordFile, self.repoPath) + command = 'export PATH=${PATH}:/usr/bin && restic -r %s:%s backup %s --password-file %s --exclude %s --exclude /home/%s/backup' % ( + self.backupDestinations, remotePath, backupPath, self.passwordFile, self.repoPath, self.website.domain) # If /home/%s/backup-exclude.conf file exists lets pass this to restic by appending the command to end. if os.path.isfile(backupExcludesFile): command = command + resticBackupExcludeCMD