Throttle bandwidth used by ftp on Linux from the command line

In a word: lftp – a sophisticated file transfer program.

So for example you want to transfer a massive Zope Data.fs file from an ftp server and you don’t have ssh access and can’t use rsync. Amongst it’s many features lftp lets you limit the number of connections to the server and the amount of bandwidth to consume. It is also installed by default on many Linux distros.
To configure it you need to add or edit ~/.lftp/rc

to set it to 1 connection at 1Mb/s (given in bytes) use the following

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

An important practical use for this it to prevent an ftp dowload from interrupting your listening to weenradio


1 thought on “Throttle bandwidth used by ftp on Linux from the command line”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s