« Grading VoIP Call Quality | Main
Monday
Apr132009

Recursive wget for FTPing a directory structure

I know, I know - you don't use FTP anymore. You've been fully indoctrinated in the Way of Secure Sockets and would never use a protocol that passes your password in plaintext with such a flippant disregard for security. I'm with you.

But sometimes you have to. Someone puts a bunch of files on a server somewhere, emails you an FTP login, and you don't have time to wait on them to upgrade their system for 21st-century standards like FTPS, SFTP, or even SCP. Here's a tip for quickly grabbing a directory structure over FTP to a Linux box.

Using the recursive and FTP switches for wget, we can do this (all on one line):

wget -r --ftp-username=<username> 
  --ftp-password=<secret> 
  ftp://domain.com/path

That will fetch everything into a new directory structure at ./domain.com/path on your machine. When I used this, I logged into a webserver I control to run the wget FTP datacenter-to-datacenter (bigger pipes) and then tarred and gzipped the result to download it locally.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>