6085 comments
2357 subscribers
6224 on Twitter
Subscribe! Feed reader E-mail

Working with FTP sites

One of the Drupal sites I’m working on is on a web host that allows only FTP access, not SSH or SCP access. I set up a local development environment so that I can play around without affecting the integration or production site. This also lets me use drush to do a group upgrade of modules without downloading and installing them one by one. But without the convenience of rsync over ssh, how can I easily transfer my updated code to the server?

lftp is a free Linux/UNIX tool for working with files over FTP. Packages are available on major distros, so installing it as easy as apt-get install lftp or working with your distro’s package manager. To start an lftp session, type lftp user@host. It supports the usual FTP commands, but it also has a few nifty additions. For example, here are some commands I use often:

lftp mirror somedirectory :: Recursively copy somedirectory from the remote computer to the local computer lftp mirror -R somedirectory :: Recursively copy somedirectory from your local computer to the remote computer lftp mirror -R somedirectory destination :: Recursively copy somedirectory to destination – saves me a lot of cd and lcd-ing lftp mirror -R --dry-run somedirectory :: Don’t actually copy somedirectory; print out the commands that would have been run

It’s smart enough to transfer only files that have changed, which is much better than having to remember and copy them. It can also use parallel connections for extra speed.

Type help at the lftp command prompt to find out more, or check out the lftp webpage. Hope this saves you time!

Short URL: http://sachachua.com/blog/p/22492
  • rjh

    lftp also has a very rich command line capability, so you can write sophisticated scripts to do automatic operations on multiple directories and files.

    • http://sachachua.com Sacha Chua

      Ooh, can’t wait to check those out. I’d rather be on an sshable server, though!

On This Day...

  • 2010: Week ending October 10, 2010 — From the other week’s plans: Work [X] Organize Idea Labs: Run report for external Idea Lab Take a break! Sent spreadsheet [...]
  • 2008: Week ending Oct 12 — Text: IBM’s Innovation Jam was a lot of fun. I focused on it because it was a great opportunity to connect [...]
  • 2008: Sewing: Red jacket, V8343 — I’m working on a red jacket now. I’ve been meaning to pick up a red jacket, but I’d never found [...]
  • 2007: Setting priorities — For once, my random Emacs symbol is strangely apropos. There will never be enough time in the day, and it’s easier [...]
  • 2007: Through the fear — I’m not afraid of heights, just falling. I _enjoy_ the challenge of speaking in front of people or turning up in [...]
  • 2007: Taking portraits of people — Ian Irving was kind enough to not only introduce me to a wonderful little cafe (Lou’s Coffee Bar at Runnymede [...]
  • 2007: Chapter is taking shape — After a little bit of [[http://sachachua.com/notebook/wiki/2007.10.12.php#anchor-2][thinking about Org and Planner]], I’m starting to feel more comfortable with the chapter that I’m writing. I [...]
  • 2007: How I came to love Emacs — Riffing off P.F. Hawkins’ post on how he came to love Emacs, let me tell you my story. =) I wasn’t [...]
  • 2007: Switching mindsets — One of the interesting side-effects of writing this book on Emacs is that I get to stretch my brain by trying [...]
  • 2007: Circus school — The static trapeze lessons I’ve been taking are tons of fun and great motivation to exercise more. (11 straight days [...]
  • 2006: Stretch — I love looking back at the day and knowing that I finished everything I set out to do. I can get [...]
  • 2006: Emacs and a British voice — There’s something about deep, deep cultural programming. Anything spoken with a British accent just sounds infinitely cool. Everyone uses the default voice [...]
  • 2006: Emacs: Quick way to collect references — (defvar sacha/planner-collector-buffer nil "Buffer for collecting links.") (defun sacha/planner-collect-reference () (interactive) (let ((text (sacha/yank-blog-reference-for-summary))) (with-current-buffer sacha/planner-collector-buffer [...]
  • 2006: Meeting minutes from KMD2004 — Started 2:20 PM Ended 3:00 PM Attendance: Dave Kemp, Sacha Chua Talked about tentative plans for lit review. Sacha will probably choose one [...]
  • 2006: The Constant Connector — I spent some time reviewing all of my blog posts that contained the keyword “networking”. I think you’ll find the [...]
  • 2005: Stepping outside my comfort zone — I get a thrill out of speaking at the edge of my comfort zone. In my Toastmasters speech about rediscovering theatre, [...]
  • 2005: Speech practice — I’ve just realized how amazingly useful a digital voice recorder is in preparing for a speech. I can record myself, listen [...]
  • 2005: Novell usability results — From David Tang of Novell: Extensive usability research, including video trials, is now available to developers worldwide at betterdesktop.openSUSE.org Totally awesome! Good karma [...]
  • 2005: Toastmasters Humorous Speech contest tomorrow — Searching the Net for tips on Toastmasters humorous speech competitions, I ran across Steve Pavlina‘s blog entry about his division’s humorous [...]
  • 2005: Nearly full CPU utilization — This week is quite a challenge. Two major things on my plate: the Toastmasters competition tomorrow and the lab report due [...]
  • 2005: MIE mishaps — I’m starting to think that my class finds me amusing. They laugh whenever they see me get stressed out. Today was supposed [...]
  • 2004: Finished 300 kanji book! — It’s a bit hard to believe that we’ve managed to finish the 300 kanji book that seemed so intimidating back when [...]
  • 2004: Places Ranulf wants to go to — Chicago: 6-31-21 Jingumae, Shibuya-ku. On Omotesando Dori, between Meiji Dori and Harajuku Station. (Near Meiji Jingumae or Harajuku.) Great! I went to [...]
  • 2004: Contact information for Ranulf’s conference — +81-3-348-58492 APR Workshop on the role of ICT in the Youth Programme
  • 2004: Japanese technical vocabulary — Thought I should start blogging the technical words I find on mailing lists. =) Warning: translations are just my guesses… ·ë¶É¡¢¤ä¤ê¤¿¤¤¤³¤È¤Ï¥Õ¥¡¥¤¥ë¶¦Í­¤Ç¤¹¤«¡£ Is file [...]
  • 2004: u-color-cycle.el — Ulf Jasper’s u-color-cycle.el smoothly changes the color of all text in a window or region while you stare at it, mesmerized. It [...]
  • 2004: ssh-copy-id — ssh-copy-id copies the id_dsa.pub file located in your .ssh/ to machine2 using ssh. It sets up the authorized_key file and permissions [...]
  • 2003: ARGH! — Ctrl-c’d my oocalc instead of my appletviewer.
  • 2003: Anonymous quote from Mario’s sig — I sit in my cubicle, here on the motherworld. When I die, they will put my body in a box and dispose [...]
  • 2003: Lambda the Ultimate, a programming weblog — http://lambda.weblogs.com/departments

Get the highlights as a PDF!

Stories from my Twenties: Highlights from a Decade of Blogging