Lftp default timeout and retry?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite
1












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?










share|improve this question

























    up vote
    1
    down vote

    favorite
    1












    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?










    share|improve this question























      up vote
      1
      down vote

      favorite
      1









      up vote
      1
      down vote

      favorite
      1






      1





      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?










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 5 at 9:39









      membersound

      214117




      214117




















          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
          "





          share|improve this answer
















          • 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










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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
          "





          share|improve this answer
















          • 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














          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
          "





          share|improve this answer
















          • 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












          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
          "





          share|improve this answer












          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
          "






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 5 at 11:41









          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












          • 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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491