I am trying to move the contents from source directory C:\report
to the remote directory remote_server_path/Test
. Below is the code that I am trying with. Instead of just moving the contents of C:\report
, it moves along the folder as such to the remote location. Any recommendations on how this could not be done?
import paramiko
from scp import SCPClient
import os
# create variables
host = "host"
username = "uname"
password = "password"
# Move files from network drive to marketing server
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname=host, username=username, password=password)
scp = SCPClient(ssh.get_transport())
scp.put('C:\\report', recursive=True, remote_path='remote_server_path/Test')