Skip to content

Commit

Permalink
restart mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Nov 12, 2024
1 parent 6778ad1 commit fba679c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 9 additions & 3 deletions backup/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,15 @@ def localInitiate(request):
data = json.loads(request.body)
randomFile = data['randomFile']

if os.path.exists(randomFile):
wm = BackupManager()
return wm.submitBackupCreation(1, json.loads(request.body))
try:
randInt = int(randomFile)
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:
logging.writeToFile(str(msg))

Expand Down
6 changes: 3 additions & 3 deletions plogical/backupSchedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ def createLocalBackup(virtualHost, backupLogPath):
backupSchedule.remoteBackupLogging(backupLogPath, "Starting local backup for: " + virtualHost)

###

pathToFile = "/home/cyberpanel/" + str(randint(10**9, 10**10 - 1))
randNBR = str(randint(10**9, 10**10 - 1))
pathToFile = "/home/cyberpanel/" + randNBR
file = open(pathToFile, "w+")
file.close()

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)

if os.path.exists(ProcessUtilities.debugPath):
Expand Down

0 comments on commit fba679c

Please sign in to comment.