mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 02:16:50 +02:00
CP-16: Admin Back Up Start Transfer
This commit is contained in:
@@ -1142,6 +1142,9 @@ class BackupManager:
|
|||||||
command = "sudo mkdir " + localStoragePath
|
command = "sudo mkdir " + localStoragePath
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
command = 'chmod 600 %s' % (localStoragePath)
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
final_json = json.dumps(
|
final_json = json.dumps(
|
||||||
{'remoteTransferStatus': 1, 'error_message': "None", "dir": data['dir']})
|
{'remoteTransferStatus': 1, 'error_message': "None", "dir": data['dir']})
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ class remoteTransferUtilities:
|
|||||||
if not os.path.exists(destination):
|
if not os.path.exists(destination):
|
||||||
os.makedirs(destination)
|
os.makedirs(destination)
|
||||||
|
|
||||||
|
command = 'chmod 600 %s' % (destination)
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
writeToFile = open(backupLogPath, "w+")
|
writeToFile = open(backupLogPath, "w+")
|
||||||
|
|
||||||
writeToFile.writelines("############################\n")
|
writeToFile.writelines("############################\n")
|
||||||
@@ -144,6 +147,11 @@ class remoteTransferUtilities:
|
|||||||
|
|
||||||
completePathToBackupFile = retValue[1] + '.tar.gz'
|
completePathToBackupFile = retValue[1] + '.tar.gz'
|
||||||
|
|
||||||
|
### change permissions of backup file
|
||||||
|
|
||||||
|
command = 'chmod 600 %s' % (completePathToBackupFile)
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
## move the generated backup file to specified destination
|
## move the generated backup file to specified destination
|
||||||
|
|
||||||
if os.path.exists(completePathToBackupFile):
|
if os.path.exists(completePathToBackupFile):
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class Upgrade:
|
|||||||
FNULL = open(os.devnull, 'w')
|
FNULL = open(os.devnull, 'w')
|
||||||
count = 0
|
count = 0
|
||||||
while True:
|
while True:
|
||||||
res = subprocess.call(shlex.split(command), stdout=FNULL, stderr=subprocess.STDOUT)
|
res = subprocess.call(shlex.split(command), stderr=subprocess.STDOUT)
|
||||||
if res != 0:
|
if res != 0:
|
||||||
count = count + 1
|
count = count + 1
|
||||||
Upgrade.stdOut(component + ' failed, trying again, try number: ' + str(count), 0)
|
Upgrade.stdOut(component + ' failed, trying again, try number: ' + str(count), 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user