Lftp default timeout and retry?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
1
down vote
favorite
Where can I find the defaults for lftp
? Eg net:max-retries
and net:timeout
.
I'm asking because I get some **** Data socket error (Connection timed out) - reconnecting
message in my lftp debug log. And it seems to retry forever if I don't quit the process manually. Which is bad for cron jobs.
Questions:
How could I explicit set the timeout and retries for one special script, which is as follows:
lftp -c "
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
And how could I catch any sync errors in the batch file above, so that I could eg send an email notification on max timeouts?
cron ftp
add a comment |Â
up vote
1
down vote
favorite
Where can I find the defaults for lftp
? Eg net:max-retries
and net:timeout
.
I'm asking because I get some **** Data socket error (Connection timed out) - reconnecting
message in my lftp debug log. And it seems to retry forever if I don't quit the process manually. Which is bad for cron jobs.
Questions:
How could I explicit set the timeout and retries for one special script, which is as follows:
lftp -c "
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
And how could I catch any sync errors in the batch file above, so that I could eg send an email notification on max timeouts?
cron ftp
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Where can I find the defaults for lftp
? Eg net:max-retries
and net:timeout
.
I'm asking because I get some **** Data socket error (Connection timed out) - reconnecting
message in my lftp debug log. And it seems to retry forever if I don't quit the process manually. Which is bad for cron jobs.
Questions:
How could I explicit set the timeout and retries for one special script, which is as follows:
lftp -c "
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
And how could I catch any sync errors in the batch file above, so that I could eg send an email notification on max timeouts?
cron ftp
Where can I find the defaults for lftp
? Eg net:max-retries
and net:timeout
.
I'm asking because I get some **** Data socket error (Connection timed out) - reconnecting
message in my lftp debug log. And it seems to retry forever if I don't quit the process manually. Which is bad for cron jobs.
Questions:
How could I explicit set the timeout and retries for one special script, which is as follows:
lftp -c "
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
And how could I catch any sync errors in the batch file above, so that I could eg send an email notification on max timeouts?
cron ftp
cron ftp
asked Mar 5 at 9:39
![](https://i.stack.imgur.com/d3dZP.png?s=32&g=1)
![](https://i.stack.imgur.com/d3dZP.png?s=32&g=1)
membersound
214117
214117
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Still I don't know how to find out the defaults. But could change them as follows:
lftp -c "
set net:timeout 5;
set net:max-retries 3;
set net:reconnect-interval-multiplier 1;
set net:reconnect-interval-base 5;
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
1
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
Of course$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.
â membersound
Mar 5 at 14:43
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Still I don't know how to find out the defaults. But could change them as follows:
lftp -c "
set net:timeout 5;
set net:max-retries 3;
set net:reconnect-interval-multiplier 1;
set net:reconnect-interval-base 5;
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
1
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
Of course$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.
â membersound
Mar 5 at 14:43
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
add a comment |Â
up vote
1
down vote
Still I don't know how to find out the defaults. But could change them as follows:
lftp -c "
set net:timeout 5;
set net:max-retries 3;
set net:reconnect-interval-multiplier 1;
set net:reconnect-interval-base 5;
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
1
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
Of course$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.
â membersound
Mar 5 at 14:43
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Still I don't know how to find out the defaults. But could change them as follows:
lftp -c "
set net:timeout 5;
set net:max-retries 3;
set net:reconnect-interval-multiplier 1;
set net:reconnect-interval-base 5;
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
Still I don't know how to find out the defaults. But could change them as follows:
lftp -c "
set net:timeout 5;
set net:max-retries 3;
set net:reconnect-interval-multiplier 1;
set net:reconnect-interval-base 5;
open $HOST
user $USER $PASS
lcd $SOURCEFOLDER
mirror --delete --verbose $FSOURCE $FTARGET
exit
"
answered Mar 5 at 11:41
![](https://i.stack.imgur.com/d3dZP.png?s=32&g=1)
![](https://i.stack.imgur.com/d3dZP.png?s=32&g=1)
membersound
214117
214117
1
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
Of course$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.
â membersound
Mar 5 at 14:43
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
add a comment |Â
1
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
Of course$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.
â membersound
Mar 5 at 14:43
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
1
1
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try set -d to view default value of lftp variable. if net:max-retries is set to 0 means unlimited. 1 means no retries.
â Lety
Mar 5 at 13:13
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
try echo $? lftp should return a value other then 0 in case of errors
â Lety
Mar 5 at 14:29
Of course
$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.â membersound
Mar 5 at 14:43
Of course
$?
gives the exit code if lftp exists with error. BUT the problem here is that by default lftp tried to reconnect endless times by default. So the exitcode evaluation would never take place, as the code is never reached.â membersound
Mar 5 at 14:43
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
did you try set -d to view default value? I guess that max-retries is set to 0, this is why your command did not end. So, I think your answer is correct.
â Lety
Mar 5 at 15:05
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1012006%2flftp-default-timeout-and-retry%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password