Hi David,

Unfortunately, recursive file transfer was not implemented in version 2 -
if you search this section for 'recursive' you'll see some notes on why and
potential workarounds: https://www.fabfile.org/upgrading.html#file-transfer

Best,
Jeff

On Thu, Jun 12, 2025 at 4:39 PM David Capone <[email protected]> wrote:

> I am having difficulty understanding how to use the put method to transfer
> a directory recursively.
>
> I am coming from using pysftp and using the put_r method.
>
> I have a local path and a remote path and I am simply trying to upload the
> local path recursively into the remote path.
>
> local_path: /test
> remote_path: /backups
>
> I have tried:
> c.put(local_path,remote_path)
> c.put(open(local_path),remote_path)
> c.put(Path(local_path),remote_path)
>
> I have also tried all of the above with remote path only assigned
> "backups".
>
> My goal is for the remote server to have /backups/test after the entire
> directory is uploaded into that path.
>
> Any guidance would be appreciated.
>


-- 
Jeff Forcier
Linux sysadmin; Python engineer
https://bitprophet.org

Reply via email to