Sander Smeenk | 2 Feb 2010 16:46

Re: lftp variable issue

> What I want to do is work with some variables in a lftp script or
> passing them to the lftp prompt.  For instance: instead of CD'ing to a
> dir on the remote site, I would like to do the following
> 
> BACKUP=/home/backup/
> Lftp open mybackupprovider; cd $BACKUP; put backup.tar.gz; bye
> 
> Is this currently possible, and if so, how do I do this?

You'd have to script that. Something like this:

| #!/bin/bash
| BACKUP=/home/backup
| 
| TMPFILE=`mktemp`
| cat <<EOC >${TMPFILE}
| open mybackupprovider
| cd $BACKUP
| put backup.tar.gz
| EOC
| 
| lftp -c ${TMPFILE}
| 
| rm ${TMPFILE}

Should work, i suppose. :)

-Sndr.
--

-- 
| You will experience a strong urge to do good; but it will pass.
(Continue reading)

Sidharth Anand Naik | 4 Feb 2010 04:57
Favicon

Connection Error from Linux to Windows while using Lftp

Hi,

 

We are using lftp client to connect to a Windows 2008 ftp server which is behind a firewall.

 

Lftp client is installed on Red Hat Linux Version [RHEL4 Update4].

 

We have openssl version openssl-0.9.8l on the linux machine.

 

Lftp client machine is behind firewall.

 

When we try to connect, the connection opens but then we get a error.

 

Following is the list of commands and error

 

 

Debug

Open Ftps://210.212.28.180:990

----resolving host address

-- 1 address found

Login domainname\userid password

Set ftp:passive-mode yes

Put test.txt

 

---- connecting to 210.212.28.180 port 990

SSL_Connect: error 0D0680A8: asn1 encoding routines: ASN1_CHECK_TLEN: wrong tag

 

-- closing control socket

 

Need your help to fix this issue.

 

Regards,

Sidharth Naik

Dan Ragle | 4 Feb 2010 18:18

disable ssl session reuse? Problem with data connection to WS_FTP

When attempting to connect to a WS_FTP server (6.1) from lftp
(4.0.5) using FTP/SSL and both client/server certificates, I'm
finding that data/list connections won't work. The initial
control connection via SSL works fine; but then when I attempt
to download a file I get:

**** SSL_connect: error:00000000:lib(0):func(0):reason(0)

In researching the issue, it seems as though the problem may be
related to poor (or pehaps no?) SSL session reuse capabilities in
WS_FTP server. When connecting to the same server in curl I am able
to bypass the problem by using the --no-sessionid command line
parameter, which forces the entire SSL handshake/connection to be
reprocessed when the data connection is established and all then
proceeds smoothly.

Is there a similar type of option in lftp? I am able to connect
to the server and download files when I:

     set ftp:ssl-protect-data off
     set ftps:initial-prot C

but if possible I'd like to have the ssl enabled.

Any help or clarification would be appreciated!

Dan

David Rushton | 6 Feb 2010 00:30
Picon
Favicon

Re: LFTP - Feature suggestion

Hi there,

Is there some way to copy all the files from a local directory to a
remote directory and then delete the files in the local directory?

I notice that

mput -E *

and

mirror -R --Remove-source-files

both leave the local files there.

Dave 

José Romildo Malaquias | 16 Feb 2010 15:15
Picon

Stop fxp mirror

Hello.

I have started using lftp a few days ago. I am using it to transfer some
files from one ftp server to another ftp server using the fxp protocol,
with a command like the following in a terminal:

$ lftp -c "mirror --verbose=3 --log=fxp.log -c ftp://user1:passwd1 <at> host1:port1/path1/file ftp://user2:passwd2 <at> host2:port2/path2/"

How can I stop the fxp transfer once for all? Hiting control+c finishes
the command above, but it seems that the transfer does not stop. The man
page sugests that lftp will move itself to nohup mode in background. If
I really want to kill the transfer, what should I do?

Regards,

Romildo

José Romildo Malaquias | 16 Feb 2010 16:17
Picon

Re: Stop fxp mirror

On Tue, Feb 16, 2010 at 12:15:37PM -0200, José Romildo Malaquias wrote:
> Hello.
> 
> I have started using lftp a few days ago. I am using it to transfer some
> files from one ftp server to another ftp server using the fxp protocol,
> with a command like the following in a terminal:
> 
> $ lftp -c "mirror --verbose=3 --log=fxp.log -c ftp://user1:passwd1 <at> host1:port1/path1/file ftp://user2:passwd2 <at> host2:port2/path2/"

I have another question in this context:

Why sometimes lftp changes to "[Receiving data->Sending data]". Clearly it
stopped doing fxp, as traffic is going through my local computer.

It is not enough to stop the command with control+c, as even after lftp
seems to be finished, the traffic continues and "ps -ef | grep fxp" does
not show a lftp process.

So what is the best way of interrupting the ftp traffic in my local
computer in this case?

Romildo

Kyle Thurow | 17 Feb 2010 03:40
Picon

Re: Stop fxp mirror

In response to your original email, if lftp backgrounds, the crude way
of stopping it is "killall lftp".

If you'd rather lftp didn't background in the first place, I recommend
adding "set cmd:move-background no" to ~/.lftp/rc

You seem to indicate the traffic continues even if the lftp process
has been killed?  First of all, I think "ps -ef | grep fxp" isn't the
best command. You should be grepping for lftp, not fxp (you won't
necessarily always have "fxp" in your lftp commands) . Even if you
manage to kill lftp, I'm not sure that you can stop the transfer from
your computer because the two servers independently negotiate the tcp
transfer. But I'm not too familiar with the details of fxp.

If lftp changes to "[Receiving data->Sending data]" it probably means
one or both of the servers don't allow fxp. lftp must then route the
traffic through you're connection to make it work. Talk to the server
admins to get fxp enabled.

2010/2/16 José Romildo Malaquias <j.romildo <at> gmail.com>:seems to be
finished, the traffic continues and "ps -ef | grep fxp" does

> On Tue, Feb 16, 2010 at 12:15:37PM -0200, José Romildo Malaquias wrote:
>> Hello.
>>
>> I have started using lftp a few days ago. I am using it to transfer some
>> files from one ftp server to another ftp server using the fxp protocol,
>> with a command like the following in a terminal:
>>
>> $ lftp -c "mirror --verbose=3 --log=fxp.log -c ftp://user1:passwd1 <at> host1:port1/path1/file ftp://user2:passwd2 <at> host2:port2/path2/"
>
> I have another question in this context:
>
> Why sometimes lftp changes to "[Receiving data->Sending data]". Clearly it
> stopped doing fxp, as traffic is going through my local computer.
>
> It is not enough to stop the command with control+c, as even after lftp
> seems to be finished, the traffic continues and "ps -ef | grep fxp" does
> not show a lftp process.
>
> So what is the best way of interrupting the ftp traffic in my local
> computer in this case?
>
> Romildo
>

spamvoll | 19 Feb 2010 22:10

skiplist

Hi..

does lftp not have a skiplist ?
ive found only an exclude in mirror mode.

and is it possible to add files to a queue by executing lftp from bash
again and not beeing inside lftp?

what im trying to do is to find a way to run a script by cron that fxp
files from Server A to B and using a special skiplist.
when the job isnt finished when the script runs again it should append
the new stuff to the old queue.

cheers

Justin Piszcz | 19 Feb 2010 22:36

Re: skiplist

Hi,

You can add files to your exclude list in $HOME/.lftprc.

Justin.

On Fri, 19 Feb 2010, spamvoll <at> googlemail.com wrote:

> Hi..
>
> does lftp not have a skiplist ?
> ive found only an exclude in mirror mode.
>
> and is it possible to add files to a queue by executing lftp from bash
> again and not beeing inside lftp?
>
> what im trying to do is to find a way to run a script by cron that fxp
> files from Server A to B and using a special skiplist.
> when the job isnt finished when the script runs again it should append
> the new stuff to the old queue.
>
> cheers
>

Sorin Sbarnea | 22 Feb 2010 12:48
Picon
Gravatar

rm job is failing when the folder does not exist - lftp returns 256

Currently LFTP returns code 256 if you try to remove a directory that
does not exists. I think it should return 0 (no error) in this case.
Returning an error code means that task failed but the directory does
not exist anymore so is nothing to delete.

rm: Access failed: 550 /path: No such file or folder.
2010-02-20 05:11:09,593 ERROR    lftp returned 256

This behavior prevents the usage of LFTP in automation tasks because
it does report an error when in fact it is no error. In addition code
256 is return for all kinds of errors so there is no way of knowing
that the job really failed or not (in this case if the directory is
still on the server or not).

Thanks,
--
/sorin
http://blog.i18n.ro


Gmane