mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
restart mysql
This commit is contained in:
@@ -421,9 +421,15 @@ def localInitiate(request):
|
|||||||
data = json.loads(request.body)
|
data = json.loads(request.body)
|
||||||
randomFile = data['randomFile']
|
randomFile = data['randomFile']
|
||||||
|
|
||||||
if os.path.exists(randomFile):
|
try:
|
||||||
wm = BackupManager()
|
randInt = int(randomFile)
|
||||||
return wm.submitBackupCreation(1, json.loads(request.body))
|
pathToFile = "/home/cyberpanel/" + randomFile
|
||||||
|
|
||||||
|
if os.path.exists(pathToFile):
|
||||||
|
wm = BackupManager()
|
||||||
|
return wm.submitBackupCreation(1, json.loads(request.body))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
logging.writeToFile(str(msg))
|
logging.writeToFile(str(msg))
|
||||||
|
|
||||||
|
|||||||
@@ -52,14 +52,14 @@ class backupSchedule:
|
|||||||
backupSchedule.remoteBackupLogging(backupLogPath, "Starting local backup for: " + virtualHost)
|
backupSchedule.remoteBackupLogging(backupLogPath, "Starting local backup for: " + virtualHost)
|
||||||
|
|
||||||
###
|
###
|
||||||
|
randNBR = str(randint(10**9, 10**10 - 1))
|
||||||
pathToFile = "/home/cyberpanel/" + str(randint(10**9, 10**10 - 1))
|
pathToFile = "/home/cyberpanel/" + randNBR
|
||||||
file = open(pathToFile, "w+")
|
file = open(pathToFile, "w+")
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
port = ProcessUtilities.fetchCurrentPort()
|
port = ProcessUtilities.fetchCurrentPort()
|
||||||
|
|
||||||
finalData = json.dumps({'randomFile': pathToFile, 'websiteToBeBacked': virtualHost})
|
finalData = json.dumps({'randomFile': randNBR, 'websiteToBeBacked': virtualHost})
|
||||||
r = requests.post("https://localhost:%s/backup/localInitiate" % (port), data=finalData, verify=False)
|
r = requests.post("https://localhost:%s/backup/localInitiate" % (port), data=finalData, verify=False)
|
||||||
|
|
||||||
if os.path.exists(ProcessUtilities.debugPath):
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
|||||||
Reference in New Issue
Block a user