scp with paramiko

Discussion in 'Python' started by cerr, Sep 1, 2010.

  1. cerr

    cerr Guest

    Hi There,

    I want to download a file from a client using paramiko. I found plenty
    of ressources using google on how to send a file but none that would
    describe how to download files from a client.
    Help would be appreciated!
    Thanks a lot!

    Ron
    cerr, Sep 1, 2010
    #1
    1. Advertising

  2. Hello,

    On Wed, Sep 01, 2010 at 09:56:18AM -0700, cerr
    wrote:
    > I want to download a file from a client using
    > paramiko. I found plenty of ressources using
    > google on how to send a file but none that
    > would describe how to download files from a
    > client.


    Download files from remote to local?
    Get sftp object as usual, then e.g.:

    for f in sftp.listdir(rdir):
    lf = os.path.join(opts.tmpdir, f)
    sftp.get(rdir + "/" + f, lf)

    sftp.get() uses path + "/" + basename instead
    of os.path.join() because the latter uses local
    pathname conventions which may or may not be
    appropriate for remote system.

    --
    With best regards,
    xrgtn
    Alexander Gattin, Sep 14, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xavier

    Classes SSH-SCP for Java

    Xavier, Oct 27, 2004, in forum: Java
    Replies:
    9
    Views:
    10,141
    Michael Borgwardt
    Nov 5, 2004
  2. mark | r

    scp crit 2

    mark | r, Dec 6, 2005, in forum: HTML
    Replies:
    7
    Views:
    645
    mark | r
    Dec 15, 2005
  3. Michael

    scp in python

    Michael, Sep 17, 2003, in forum: Python
    Replies:
    4
    Views:
    10,419
    David Mertz
    Sep 23, 2003
  4. krabhi
    Replies:
    1
    Views:
    9,290
    Marco Meschieri
    Aug 9, 2006
  5. Une Bévue
    Replies:
    0
    Views:
    377
    Une Bévue
    Jul 22, 2008
Loading...

Share This Page