Guest User

Untitled

a guest
Oct 1st, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import pysftp
  2. remotepath = '/home/a7user/sftp/sftp/CentralData/'
  3. localpath = 'E:\backup\'
  4. cnopts = pysftp.CnOpts()
  5. cnopts.hostkeys = None
  6.  
  7. with pysftp.Connection(host='xx.xxx.xx.xx',username='user',password='5fTPt00',cnopts=cnopts) as sftp:
  8.  
  9. sftp.put_d(localpath,remotepath)
  10. print('Upload finished')
Add Comment
Please, Sign In to add comment