mirror

Downloading whole directory with FTP

It seems that it is not possible to download or upload folders using the ftp command. Until now I have been using FileZilla, the GUI ftp client for most of my ftp works. Well GUI is GUI and is not always available.

Turns out, there is this awesome lftp command that does the job pretty well. It is like the bash shell but for ftp with lots of tricks up its sleeve. It even does a remote auto completion, awesome.

  1. $ lftp
  2. lftp :~> o ftp.servername.com
  3. lftp ftp.servername.com:~> user USERNAMEHERE
  4. Password: PASSWORD HERE

this much is like the old ftp command.

To upload the whole folder to the remove server

  1. lftp :~> mirror -R /path/to/local/folder /path/to/remote/folder

by default, mirror command downloads files from remote source folder to local folder. Option -R means reverse the process where by, instead of downloading, it uploads the local/folder to remote/folder location.

Syndicate content