mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-15 12:02:06 +01:00
bug fix: schedule backup logs
This commit is contained in:
@@ -230,26 +230,13 @@ class backupSchedule:
|
||||
|
||||
if os.path.exists(backupSchedule.runningPath):
|
||||
pid = open(backupSchedule.runningPath, 'r').read()
|
||||
print('Remote backup is already running with PID: %s. If you want to run againly kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid))
|
||||
print('\n\nRemote backup is already running with PID: %s. If you want to run again kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid))
|
||||
return 0
|
||||
|
||||
writeToFile = open(backupSchedule.runningPath, 'w')
|
||||
writeToFile.write(str(os.getpid()))
|
||||
writeToFile.close()
|
||||
|
||||
|
||||
destinations = backupUtilities.destinationsPath
|
||||
|
||||
backupLogPath = "/usr/local/lscp/logs/backup_log."+time.strftime("%m.%d.%Y_%H-%M-%S")
|
||||
|
||||
|
||||
backupSchedule.remoteBackupLogging(backupLogPath,"#################################################")
|
||||
backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S"))
|
||||
backupSchedule.remoteBackupLogging(backupLogPath,"#################################################\n")
|
||||
|
||||
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
||||
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
||||
|
||||
## IP of Remote server.
|
||||
|
||||
destinations = backupUtilities.destinationsPath
|
||||
@@ -266,10 +253,24 @@ class backupSchedule:
|
||||
jobSuccessSites = 0
|
||||
jobFailedSites = 0
|
||||
|
||||
backupLogPath = "/usr/local/lscp/logs/backup_log." + time.strftime("%m.%d.%Y_%H-%M-%S")
|
||||
|
||||
backupSchedule.backupLog = BackupJob(logFile=backupLogPath, location=backupSchedule.REMOTE,
|
||||
jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites, ipAddress=ipAddress, port=port)
|
||||
jobSuccessSites=jobSuccessSites, jobFailedSites=jobFailedSites,
|
||||
ipAddress=ipAddress, port=port)
|
||||
backupSchedule.backupLog.save()
|
||||
|
||||
|
||||
destinations = backupUtilities.destinationsPath
|
||||
|
||||
|
||||
backupSchedule.remoteBackupLogging(backupLogPath,"#################################################")
|
||||
backupSchedule.remoteBackupLogging(backupLogPath," Backup log for: " +time.strftime("%m.%d.%Y_%H-%M-%S"))
|
||||
backupSchedule.remoteBackupLogging(backupLogPath,"#################################################\n")
|
||||
|
||||
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
||||
backupSchedule.remoteBackupLogging(backupLogPath, "")
|
||||
|
||||
## IPAddress of local server
|
||||
|
||||
ipFile = "/etc/cyberpanel/machineIP"
|
||||
|
||||
@@ -30,7 +30,7 @@ class backupScheduleLocal:
|
||||
|
||||
if os.path.exists(backupScheduleLocal.runningPath):
|
||||
pid = open(backupScheduleLocal.runningPath, 'r').read()
|
||||
print('Local backup is already running with PID: %s. If you want to run againly kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid))
|
||||
print('\n\nLocal backup is already running with PID: %s. If you want to run again kindly kill the backup process: \n\n kill -9 %s.\n\n' % (pid, pid))
|
||||
return 0
|
||||
|
||||
writeToFile = open(backupScheduleLocal.runningPath, 'w')
|
||||
|
||||
Reference in New Issue
Block a user