From 9fc0994d59ad7e9c5d606ed5bb92b4661107d8cd Mon Sep 17 00:00:00 2001 From: usmannasir <01-134132-158@student.bahria.edu.pk> Date: Mon, 26 Mar 2018 20:39:56 +0500 Subject: [PATCH] Bug fix to local backup generation. --- install/install.py | 19 +++++++++++++++---- plogical/backupScheduleLocal.py | 11 ++++++++--- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/install/install.py b/install/install.py index 81d39e403..06257d7d5 100644 --- a/install/install.py +++ b/install/install.py @@ -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!") diff --git a/plogical/backupScheduleLocal.py b/plogical/backupScheduleLocal.py index 7559c9777..a1f399aab 100644 --- a/plogical/backupScheduleLocal.py +++ b/plogical/backupScheduleLocal.py @@ -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") + "]" + " Backup Completed for: " +virtualHost + "\n") + "%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") + "%I-%M-%S-%a-%b-%Y") + "]" + " #############################################" + "\n") break + except BaseException,msg: logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")