mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
bug fix: if scp fail download via sftp
This commit is contained in:
@@ -6651,7 +6651,18 @@ class ApplicationInstaller(multi.Thread):
|
||||
statusFile.close()
|
||||
return 0
|
||||
else:
|
||||
logging.writeToFile(f"Success in scp command to retrieve backup {successRet}")
|
||||
try:
|
||||
logging.writeToFile(f"Success in scp command to retrieve backup {successRet}")
|
||||
sftp.get(f'cpbackups/{folder}/{backupfile}', f'/home/cyberpanel/{backupfile}',
|
||||
callback=self.UpdateDownloadStatus)
|
||||
except BaseException as msg:
|
||||
logging.writeToFile(f"Failed to download file {str(msg)} [404]")
|
||||
statusFile = open(tempStatusPath, 'w')
|
||||
statusFile.writelines(f"Failed to download file {str(msg)} [404]")
|
||||
statusFile.close()
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
if sftp:
|
||||
sftp.close() # Close the SFTP session
|
||||
|
||||
Reference in New Issue
Block a user