Discussion:
lftp 4.5.4
Alexander V. Lukyanov
2014-08-07 05:55:44 UTC
Permalink
lftp-4.5.4 has been released. Changes:

* new setting mirror:sort-by (name, size, date).
* torrent: reduced cpu and memory usage.
* fixed occasional "BUG:deadlock" message.
* fixed a segfault when a directory contains duplicate file names.
* fixed a memory leak in torrent.
* fixed byte counters in mirror --depth-first.
* fixed timeout checks in FISH.
* translations updated (pl).

Get it from http://lftp.yar.ru/get.html or your favorite mirror.
Binaries for Fedora 19 are also available.
--
Alexander.
Mattias Bergvall
2014-08-11 07:22:16 UTC
Permalink
Hi!

(using v 4.5.2)

I wonder how to prevent retries and to make LFTP fail-exit on connection
problems (when the server is down, for instance).

I have a command file like this:

set ftp:use-feat false
set dns:fatal-timeout 50
set net:max-retries 1
set cmd:fail-exit true
set ftp:sync-mode true
set ftp:use-site-utime false
set net:connection-limit 1
set ftp:nop-interval 15
set net:timeout 30
open ilprt1.ilnet.se
cd "/hold"
put xxx -o yyy

and get these reoccuring attempts until it succeeds:

---- Resolving host address...
---- 1 address found: 10.53.11.35
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Resolving host address...
---- 1 address found: 10.53.11.35
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Resolving host address...
---- 1 address found: 10.53.11.35
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Socket error (Connection refused) - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
**** Timeout - reconnecting
---- Closing control socket
---- Connecting to ilprt1.ilnet.se (10.53.11.35) port 21
<--- 220 EFI FTP Print server ready.
---> USER vidare
...

Is there any option I can use to make it abort and fail with non-zero
return code instead of retrying?

Thanks!

BR
Mattias Bergvall
Alexander V. Lukyanov
2014-08-11 10:53:55 UTC
Permalink
Post by Mattias Bergvall
I wonder how to prevent retries and to make LFTP fail-exit on connection
problems (when the server is down, for instance).
Please try this patch.
--
Alexander.
Mattias Bergvall
2014-08-11 11:42:47 UTC
Permalink
Great!
This patch works perfectly.

Thanks a lot! You are really quick!

BR
Mattias Bergvall
Post by Alexander V. Lukyanov
Post by Mattias Bergvall
I wonder how to prevent retries and to make LFTP fail-exit on connection
problems (when the server is down, for instance).
Please try this patch.
--
Alexander.
Loading...