bug fix backupSchedule.py

This commit is contained in:
Usman Nasir
2020-05-25 00:08:05 +05:00
parent c44e29b159
commit bcfd769306
2 changed files with 30 additions and 1 deletions

View File

@@ -88,6 +88,34 @@ class backupSchedule:
if (ifRunning.find('startBackup') > -1 or ifRunning.find('BackupRoot') > -1) and ifRunning.find('/%s/' % (backupDomain)):
pass
else:
if os.path.exists(status):
status = open(status, 'r').read()
time.sleep(2)
if status.find("Completed") > -1:
### Removing Files
command = 'sudo rm -f ' + status
ProcessUtilities.normalExecutioner(command)
command = 'sudo rm -f ' + backupFileNamePath
ProcessUtilities.normalExecutioner(command)
command = 'sudo rm -f ' + pid
ProcessUtilities.normalExecutioner(command)
backupSchedule.remoteBackupLogging(backupLogPath, "Backup Completed for: " + virtualHost)
try:
os.remove(pathToFile)
except:
pass
return 1, tempStoragePath
else:
return 0, 'Backup process killed without reporting any error.'
else:
return 0, 'Backup process killed without reporting any error.'
## file name read ends

View File

@@ -61,6 +61,7 @@ class backupScheduleLocal:
retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath)
if retValues[0] == 0:
backupSchedule.remoteBackupLogging(backupLogPath, '[ERROR] Backup failed for %s, error: %s moving on..' % (virtualHost, retValues[1]), backupSchedule.ERROR)
continue
if os.path.exists(backupScheduleLocal.localBackupPath):