Bug fix to Remote backups.

This commit is contained in:
usmannasir
2018-02-22 12:17:38 +05:00
parent 851fac636c
commit 6c4c3848b1
6 changed files with 30 additions and 32 deletions

View File

@@ -63,7 +63,7 @@ class backupSchedule:
@staticmethod
def sendBackup(backupPath, IPAddress, writeToFile,port):
try:
command = "sudo scp -P "+port+" -i /root/.ssh/cyberpanel " + backupPath + " root@"+IPAddress+":/home/backup/"+ time.strftime("%a-%b") + "/"
command = "sudo scp -o StrictHostKeyChecking=no -P "+port+" -i /root/.ssh/cyberpanel " + backupPath + " root@"+IPAddress+":/home/backup/"+ time.strftime("%a-%b") + "/"
subprocess.call(shlex.split(command), stdout=writeToFile)
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [startBackup]")

View File

@@ -16,7 +16,7 @@ class remoteTransferUtilities:
@staticmethod
def writeAuthKey(pathToKey):
try:
authorized_keys = "/root/.ssh/authorized_keys"
authorized_keys = os.path.join("/root",".ssh","authorized_keys")
presenseCheck = 0
try:
@@ -209,7 +209,7 @@ class remoteTransferUtilities:
try:
## complete path is a path to the file need to send
command = "sudo scp -i /root/.ssh/cyberpanel " + completedPathToSend + " root@" + IPAddress + ":/home/backup/transfer-" + folderNumber + "/"
command = "sudo scp -o StrictHostKeyChecking=no -i /root/.ssh/cyberpanel " + completedPathToSend + " root@" + IPAddress + ":/home/backup/transfer-" + folderNumber + "/"
subprocess.call(shlex.split(command), stdout=writeToFile)
except BaseException, msg: