@@ -216,6 +216,7 @@ def createBackup(virtualHost, ipAddress, backupLogPath , port='22', user='root')
216216
217217 backupSchedule .remoteBackupLogging (backupLogPath , "" )
218218 backupSchedule .remoteBackupLogging (backupLogPath , "" )
219+ return 1
219220 else :
220221
221222 backupSchedule .remoteBackupLogging (backupLogPath , 'Remote backup creation failed for %s.' % (virtualHost ) )
@@ -227,6 +228,7 @@ def createBackup(virtualHost, ipAddress, backupLogPath , port='22', user='root')
227228
228229 backupSchedule .remoteBackupLogging (backupLogPath , "" )
229230 backupSchedule .remoteBackupLogging (backupLogPath , "" )
231+ return 0
230232
231233 except BaseException as msg :
232234 logging .CyberCPLogFileWriter .writeToFile (str (msg ) + " [backupSchedule.createBackup]" )
@@ -332,8 +334,14 @@ def prepare():
332334
333335 for virtualHost in os .listdir ("/home" ):
334336 if match (r'^[a-zA-Z0-9-]*[a-zA-Z0-9-]{0,61}[a-zA-Z0-9-](?:\.[a-zA-Z0-9-]{2,})+$' , virtualHost , M | I ):
335- backupSchedule .createBackup (virtualHost , ipAddress , backupLogPath , port , user )
337+ if backupSchedule .createBackup (virtualHost , ipAddress , backupLogPath , port , user ):
338+ jobSuccessSites = jobSuccessSites + 1
339+ else :
340+ jobFailedSites = jobFailedSites + 1
336341
342+ backupSchedule .backupLog .jobFailedSites = jobFailedSites
343+ backupSchedule .backupLog .jobSuccessSites = jobSuccessSites
344+ backupSchedule .backupLog .save ()
337345
338346 backupSchedule .remoteBackupLogging (backupLogPath , "Remote backup job completed.\n " )
339347
0 commit comments