Directory transfers with Paramiko

How do you use Paramiko to transfer complete directories? I’m trying to use:


which is giving me this error –

Error : [Errno 21] Is a directory


You’ll need to do this just like you would locally with python (if you weren’t using shutils).

Combine os.walk(), with sftp.mkdir() and sftp.put(). You may also want to check each file and directory with os.path.islink() depending on whether you want to resolve symlinks or not.