[Python] Python fabric api recursive put

Discussão em 'Python' iniciado por Stack, Junho 12, 2025.

  1. Stack

    Stack Membro Participativo

    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.

    Continue reading...

Compartilhe esta Página