Wednesday, January 27, 2010

lftp Resources

Here's some lftp resources.

Here is what I suspect is the
lftp main website:

http://lftp.yar.ru/

The reasons I suspect that this
is the lftp main website are as
follows:

  • It seems to be the website
    of the creator and maintainer
    of lftp, Alexander V. Lukyanov.
  • I don't know of any other
    website that has more information
    that is more basic about lftp

Here's an lftp tutorial:

lftp: a better FTP client

Ed Abbott

lftp Loops Endlessly
on Empty Directories

My last post covered this very
same issue:

lftp and Empty Directories

The issue has come up again. This
time, neither the solution I discovered
nor the solution suggested in the
link (in the above post) is working.

Two solutions down the drain. Time
to try again.

OK. Just found a third work around.
Here it is.

Instead of using an lftp command
line option
like the two solutions
above mention, use a mirror command
option instead.

In lftp, mirror is how you recursively
descend into directories to grab all of them.

Here's the mirror command I was using which
was giving me a problem:

mirroc -c

Here's the new mirror command without the prolbem:

mirror -c -x "^etc/$"

Here's the most important
part of the above command:

-x "^etc/$"

The -x option allows me
to exclude directories.

In this case, the directory called
etc is empty. It is causing
lftp to loop endlessly as it
tries again and again to retrieve
directory contents that are not there.

My solution? Use -x to exclude
the directory. The -x option is
mneumonic for exclude

The cool thing about -x is that
it is a regular expression. This
allows me to be very specific.

In this case, I've said that only directories
(notice the trailing slash) that start and
end with etc are to be excluded. In
other words, etc cannot be part of
a larger pattern.

The great thing about regular expressions
is that you can be very very specific.

By the way. This solution has worked perfectly.

This may be the best workaround yet in that it
is often only one empty directory that causes
lftp to hang (loop endlessly).

Ed Abbott