1

I have a folder that I want to transfer to a ftp server with Paramiko. I have the following code:

client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect("xx.xx.xx.xx", username='user', key_filename='xxx.pem')

ftp_client = client.open_sftp()
ftp_client.put("folder/", "/home/user/folder")
ftp_client.close()

I know you can make the folder/ to a zip file, but that'll cause the zip file to be approximately as large as folder/ which is something I won't be doing in my approach.

Is there another approach? Maybe another module? Thanks.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
vsp0
  • 67
  • 4
  • 1
    See [Directory transfers with Paramiko](https://stackoverflow.com/q/4409502/850848) + Though, the easiest is to use pysftp, as [my answer shows](https://stackoverflow.com/q/4409502/850848#62057641). – Martin Prikryl Nov 09 '20 at 18:38

0 Answers0