bug fix: remove leftover if backup failed

This commit is contained in:
Usman Nasir
2020-09-11 15:44:38 +05:00
parent 2ce35a3073
commit 6e076aac5e
2 changed files with 8 additions and 1 deletions

View File

@@ -126,6 +126,9 @@ class backupSchedule:
command = 'sudo rm -f ' + pid
ProcessUtilities.normalExecutioner(command)
command = 'rm -rf %s' % (tempStoragePath)
ProcessUtilities.normalExecutioner(command)
backupObs = Backups.objects.filter(fileName=fileName)
for items in backupObs:
items.delete()
@@ -187,6 +190,10 @@ class backupSchedule:
return 0, 'Backup process killed.'
else:
if killCounter == 1:
command = 'rm -rf %s' % (tempStoragePath)
ProcessUtilities.normalExecutioner(command)
return 0, 'Backup process killed without reporting any error. [184]'
elif os.path.exists(schedulerPath):
backupSchedule.remoteBackupLogging(backupLogPath, 'Backup process killed. Error: %s' % (