Bug fix to local backup generation.

This commit is contained in:
usmannasir
2018-03-26 20:39:56 +05:00
parent d9d3dd1149
commit 9fc0994d59
2 changed files with 23 additions and 7 deletions

View File

@@ -703,8 +703,8 @@ class preFlightsChecks:
count = 0
while (1):
command = "wget http://cyberpanel.net/CyberPanel.1.6.0.tar.gz"
#command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz"
#command = "wget http://cyberpanel.net/CyberPanel.1.6.0.tar.gz"
command = "wget http://cyberpanel.net/CyberPanelTemp.tar.gz"
res = subprocess.call(shlex.split(command))
if res == 1:
@@ -723,8 +723,8 @@ class preFlightsChecks:
count = 0
while(1):
command = "tar zxf CyberPanel.1.6.0.tar.gz"
#command = "tar zxf CyberPanelTemp.tar.gz"
#command = "tar zxf CyberPanel.1.6.0.tar.gz"
command = "tar zxf CyberPanelTemp.tar.gz"
res = subprocess.call(shlex.split(command))
@@ -2480,6 +2480,16 @@ class preFlightsChecks:
return 1
def modSecPreReqs(self):
try:
pathToRemoveGarbageFile = os.path.join(self.server_root_path,"modules/mod_security.so")
os.remove(pathToRemoveGarbageFile)
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [modSecPreReqs]")
return 0
def main():
@@ -2552,6 +2562,7 @@ def main():
checks.test_Requests()
checks.download_install_CyberPanel(installCyberPanel.InstallCyberPanel.mysqlPassword)
checks.setup_cron()
checks.modSecPreReqs()
checks.installation_successfull()
logging.InstallLog.writeToFile("CyberPanel installation successfully completed!")

View File

@@ -33,13 +33,18 @@ class backupScheduleLocal:
writeToFile.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "]" + " Waiting for backup to complete.. " + "\n")
if data['status'] == 0:
if data['backupStatus'] == 0:
writeToFile.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "]" + "An error occurred, Error message: " + data['error_message'] + "\n")
break
elif data['abort'] == 1:
writeToFile.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "]" + " Backup Completed for: " + virtualHost + "\n")
writeToFile.writelines("[" + time.strftime(
"%I-%M-%S-%a-%b-%Y") + "]" + " #############################################" + "\n")
break
except BaseException,msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")