mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
bug fix backupSchedule.py
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user