Bug Fixes to Remote Transfer

This commit is contained in:
usmannasir
2017-10-27 00:09:34 +05:00
parent f41b420071
commit 4e24f610c7
4 changed files with 10 additions and 29 deletions

View File

@@ -211,8 +211,6 @@ class remoteBackup:
r = requests.post("http://localhost:5003/backup/submitRestore", data=finalData)
data = json.loads(r.text)
logging.CyberCPLogFileWriter.writeToFile(r.text)
if data['restoreStatus'] == 1:
while (1):
@@ -411,12 +409,12 @@ class remoteBackup:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")
@staticmethod
def backupProcess(ipAddress, dir, backupLogPath,folderNumber):
def backupProcess(ipAddress, dir, backupLogPath,folderNumber,accountsToTransfer):
try:
## dir is without forward slash
for virtualHost in os.listdir("/home"):
for virtualHost in accountsToTransfer:
try:
@@ -497,7 +495,7 @@ class remoteBackup:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [backupProcess]")
@staticmethod
def remoteTransfer(ipAddress, dir):
def remoteTransfer(ipAddress, dir,accountsToTransfer):
try:
destination = "/home/backup/transfer-" + dir
backupLogPath = destination + "/backup_log"
@@ -535,7 +533,7 @@ class remoteBackup:
return [0, "Host is down"]
p = Process(target=remoteBackup.backupProcess, args=(ipAddress, destination, backupLogPath,dir,))
p = Process(target=remoteBackup.backupProcess, args=(ipAddress, destination, backupLogPath,dir,accountsToTransfer))
p.start()
pid = open(destination + '/pid', "w")