Recursive get with lftp

If you’re trying to figure out how to recursively download a directory with lftp, the wonderful command-line FTP and SFTP client, this is what you want:

mirror <directory>

… and that’s that. Hopefully this will be more helpful to someone than the current Google documentation results. ;-)

Update: Thanks to molok in the comments, here’s how you upload recursively:

mirror -R <directory>
  • email
  • Print
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

7 Comments

  1. Posted December 4, 2008 at 22:05 | Permalink | Reply

    I love lftp. It’s great.

    I use mget all the time, and mirror is really useful as you suggest.

    As a related tip: Did you know you can use lftp on http as well? It understands directory indexing (such as Apache’s) and presents it in the simple lftp interface we all know and love.

  2. Posted December 4, 2008 at 23:27 | Permalink | Reply

    lftp: the zsh of ftp clients. Fucken’ A man.

  3. Posted December 4, 2008 at 23:31 | Permalink | Reply

    and ‘mirror -R’ to upload a directory… awesome.

  4. Posted December 4, 2008 at 23:50 | Permalink | Reply

    At least in Debian you need to use lftp -e mirror http://ftp.example.com for mirroring remote site.

  5. Posted December 4, 2008 at 23:55 | Permalink | Reply

    @Domas: Thanks, I’ve updated the post so it doesn’t suggest direct shell use.

  6. Don
    Posted June 22, 2009 at 15:23 | Permalink | Reply

    its annoying that you cant do a glob on a directory like:

    > mirror Foobar.*

Post a Comment

Your email is never shared. Required fields are marked *

*
*

Comments will be sent to the moderation queue.