@@ -216,6 +216,7 @@ def createBackup(virtualHost, ipAddress, backupLogPath , port='22', user='root')
216
216
217
217
backupSchedule .remoteBackupLogging (backupLogPath , "" )
218
218
backupSchedule .remoteBackupLogging (backupLogPath , "" )
219
+ return 1
219
220
else :
220
221
221
222
backupSchedule .remoteBackupLogging (backupLogPath , 'Remote backup creation failed for %s.' % (virtualHost ) )
@@ -227,6 +228,7 @@ def createBackup(virtualHost, ipAddress, backupLogPath , port='22', user='root')
227
228
228
229
backupSchedule .remoteBackupLogging (backupLogPath , "" )
229
230
backupSchedule .remoteBackupLogging (backupLogPath , "" )
231
+ return 0
230
232
231
233
except BaseException as msg :
232
234
logging .CyberCPLogFileWriter .writeToFile (str (msg ) + " [backupSchedule.createBackup]" )
@@ -332,8 +334,14 @@ def prepare():
332
334
333
335
for virtualHost in os .listdir ("/home" ):
334
336
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
336
341
342
+ backupSchedule .backupLog .jobFailedSites = jobFailedSites
343
+ backupSchedule .backupLog .jobSuccessSites = jobSuccessSites
344
+ backupSchedule .backupLog .save ()
337
345
338
346
backupSchedule .remoteBackupLogging (backupLogPath , "Remote backup job completed.\n " )
339
347
0 commit comments