Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Stop lftp from reconnecting

Posted on 2009-07-10
Last Modified: 2012-05-07
I'm trying to instruct lftp to not keep on reconnecting.

So I have created a file ~ltfprc which runs for each lftp command. Settings are picked up there. Now I'm trying to tell lftp using that file to keep reconnecting when it fails.

I noticed that it keeps reconnecting regardless of max-tries setings, so it basically reports an error: "max-retries exceeded" and then goeson  with reconnecting, so I'm quite sure I don't understand the max-retries purpose. Below is some output which shows that it keeps on reconnecting although max-retries is exceeded.

---- Connecting to ( port 21
copy: put rolled back to 0, seeking get accordingly
**** Timeout - reconnecting
---- Closing control socket
copy: put rolled back to 0, seeking get accordingly
mirror: Fatal error: max-retries exceeded
---- Connecting to ( port 21
**** Timeout - reconnecting
---- Closing control socket
mirror: Fatal error: max-retries exceeded
---- Connecting to ( port 21

Question by:ostraaten

Author Comment

ID: 24822984
Command I'm running is

lftp -u ftpuser,password -d -e "mirror -vnR '/media/My Mobile Drive/Our Pictures' /Photo/Our Photos"

I really I'm having a hard time understanding why lftp is so determined to continue running when it cannot connect.

I'm really having a hard time understanding behaviour. What lftp is basically is doing is.
try to connect to the machine
raise a fatal error because we have exceeded max-retry
try to connect another time
raise another fatal error because we have exceed max-retry
and so on....?????

LVL 68

Expert Comment

ID: 24823227
strange, indeed. I never noticed that (and I can't test at the moment, because we don't use lftp anymore).
The only thing I could suggest is to set
and see if it helps.
LVL 68

Expert Comment

ID: 24823254

cmd:fail-exit  true
of course
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

LVL 23

Expert Comment

by:Maciej S
ID: 24824073
Can you psot your ~/.lftprc file?
LVL 17

Accepted Solution

owensleftfoot earned 500 total points
ID: 24824583
Try the --max-errors option. Its not in the docs

Author Closing Comment

ID: 31602053

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
installing LSI MegaRAID Storage Manager on CentOS 7 22 724
How to make a Bash alias that takes parameters 5 72
AWS Central Authentication 1 86
android secure ftp 3 50
Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question