mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +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)):
|
if (ifRunning.find('startBackup') > -1 or ifRunning.find('BackupRoot') > -1) and ifRunning.find('/%s/' % (backupDomain)):
|
||||||
pass
|
pass
|
||||||
else:
|
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.'
|
return 0, 'Backup process killed without reporting any error.'
|
||||||
|
|
||||||
## file name read ends
|
## file name read ends
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class backupScheduleLocal:
|
|||||||
retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath)
|
retValues = backupSchedule.createLocalBackup(virtualHost, backupLogPath)
|
||||||
|
|
||||||
if retValues[0] == 0:
|
if retValues[0] == 0:
|
||||||
|
backupSchedule.remoteBackupLogging(backupLogPath, '[ERROR] Backup failed for %s, error: %s moving on..' % (virtualHost, retValues[1]), backupSchedule.ERROR)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if os.path.exists(backupScheduleLocal.localBackupPath):
|
if os.path.exists(backupScheduleLocal.localBackupPath):
|
||||||
|
|||||||
Reference in New Issue
Block a user