Jump to content

Lftp

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 193.233.48.78 (talk) at 19:50, 16 June 2006 (→‎Example of throttling bandwidth with lftp). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

You must add a |reason= parameter to this Cleanup template – replace it with {{Cleanup|June 2006|reason=<Fill reason here>}}, or remove the Cleanup template.

lftp is a command-line FTP client for UNIX and Unix-like systems. It was written by Alexander Lukyanov, and is made available under the GNU General Public License.

Besides FTP, it also supports FTPS, HTTP, HTTPS, HFTP, Fish, and SFTP by specifying the desired protocol in a location URL.

In addition to features common in advanced FTP clients, such as recursively mirroring entire directory trees, location bookmarks and resuming downloads, lftp also supports more advanced functionality. Transfers can be scheduled for execution at a later time, bandwidth can be throttled, transfer queues can be set up, and Unix shell-like job control is supported. The client can be fully scripted, instead of being used interactively.


Example of throttling bandwidth with lftp

Amongst its many features, lftp lets you limit the number of connections to the server and the amount of bandwidth to consume.

Lftp reads its settings from two configuration files: the user specific ~/.lftp/rc and the global /etc/lftp.conf. To configure it for your own uses you need to add or edit ~/.lftp/rc

E.g., to set it to open 1 connection at a maximum of 1Mb/s (given in bytes) the following can be added to ~/.lftp/rc

   set net:connection-limit 1
   set net:limit-rate 131072

If you can connect ok but everything you try to do (e.g., ls) gives you something like this:

   Fatal error: SSL connect: error:00000000:lib(0):func(0):reason(0)

then you also need to explicitly turn ssl off

   set ftp:ssl-allow false

Basic commands for lftp (and most other command line ftp programs) To connect:

  lftp username@ftpserver.org

To list the remote directory:

  ls or dir

To list the local current directory:

  !ls -l

To download aFile:

  get aFile

To upload aFile:

  put aFile

To get help:

  help

To get help on a specific command, e.g., ls

  help ls

See also