Recursive directory download with Paramiko?
I want to download a directory with unknown contents recursively via SSH and have been trying Paramiko. I have seen several examples how to upload directories but none that covers recursive download. I can list all items in a directory but haven't been able to find a way of knowing if the item is a file (to download) or a directory (to call recursively). transport = paramiko.Transport((MY_IP, 22)) transport.connect(username=MY_NAME, password=MY_PASS) sftp = paramiko.SFTPClient.from_transport(transport) file_list = sftp.listdir(path='/home/MY_HOME_DIR') for item in file_list: # Here is an item