Good afternoon,
I am getting the following error whenever I am trying to copy a test file from one directory to another on a remote server:
Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site-packages\paramiko-1.12.0-py2.7.egg\paramiko\sftp_client.py", line 612, in put file_size = os.stat(localpath).st_size WindowsError: [Error 3] The system cannot find the path specified: '/brass/prod/bin/chris/test1/km_cust'
The file I am looking to copy is called km_cust.
I am executing these commands in python 2.7.
Please note that the hostname, uid, and password were changed to generic versions and the real hostname, uid, and password can be used to ssh to the box in question and preform all functionality.
Here is my code:
import paramiko
s = paramiko.SSHClient()
s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
s.connect('hostname',username='test',password='pw')
filepath = '/brass/prod/bin/chris/test1/km_cust'
localpath = 'brass/prod/bin/chris/test2'
sftp = s.open_sftp()
sftp.put(filepath, localpath)
Any help will be apprecaited. Let me know if any other information is needed.