lftp timeout not working

Viewed 27105

I am using the following command to set timeout of lftp command so that if the server is not available or is not accepting any new connection, the command ends after 10 sec.

lftp -e 'set ftp:passive-mode true; set net:timeout 10; cd /OUT; mput $filename; bye' -u mylftpuser,mypassword myhost.com

However, the timeout does not seem to work. When I run the above command on the command prompt, it retries connecting after 30 sec, 45 sect ..60 sec ...and never ends.

Am I doing something wrong here?

Thanks.

4 Answers

In the documentation you can find more information about the location of the settings and the available options. Below you can see the file locations of the settings.

On startup, lftp executes ~/.lftprc and ~/.lftp/rc (or ~/.config/lftp/rc if ~/.lftp does not exist). You can place aliases and set commands there. Some people prefer to see full protocol debug, use debug to turn the debug on.

There is also a system-wide startup file in /etc/lftp.conf. It can be in different directory, see FILES section.

Related