More bad examples for mget. It appears using the * wildcard screws up
logging entirely :


[ast...@hannah ~]$ /usr/bin/lftp -e 'set cmd:verbose yes; set
net:max-retries 3; ; set sftp:connect-program /usr/bin/ssh -i
/oracle/10g/admin/scripts/dev_test/id_dsavito; mget *.csv; bye;' -u user,xx
sftp://my.host.com:23
*.csv: no files found
[ast...@hannah ~]$ /usr/bin/lftp -e 'set cmd:verbose yes; set
net:max-retries 3; ; set sftp:connect-program /usr/bin/ssh -i
/oracle/10g/admin/scripts/dev_test/id_dsavito; mget file.csv; bye;' -u
user,xx sftp://my.host.com:23
mget: Login failed: Login incorrect
[ast...@hannah ~]$ rpm -q lftp
lftp-3.5.1-2.fc6
[ast...@hannah ~]$

This is RHEL5 now.
The problem is i pointed it to a non existing key but only "mget file.csv"
writes the correct error whereas "mget *.csv" writes a totally misleading
error which makes you think it logged on but couldn't find the files when it
didn't even log in at all.

Am I missing something here ? How do you guys deal with that ?


On Thu, Oct 8, 2009 at 11:38 AM, stucky <[email protected]> wrote:

> Are any of the exit codes working correctly ?
> It appears mget doesn't work but get does.
> Why do they differ ?
>
> [cfern...@redford dev_test]$ /usr/bin/lftp -e 'set cmd:verbose yes; set
> net:max-retries 3; ; set sftp:connect-program /usr/bin/ssh -i
> /oracle/10g/admin/scripts/dev_test/id_dsa; mget *.ccsv; bye;' -u user,xx
> sftp://my.host.com:23
> *.ccsv: no files found
> [cfern...@redford dev_test]$ echo $?
> 0
> [cfern...@redford dev_test]$ /usr/bin/lftp -e 'set cmd:verbose yes; set
> net:max-retries 3; ; set sftp:connect-program /usr/bin/ssh -i
> /oracle/10g/admin/scripts/dev_test/id_dsa; get file.ccsv; bye;' -u user,xx
> sftp://my.host.com:23
> get: Access failed: No such file (file.ccsv)
> [cfern...@redford dev_test]$ echo $?
> 1
> [cfern...@redford dev_test]$ rpm -q lftp
> lftp-3.0.6-4.el4
>
> It's very hard to use lftp for automated processes this way.
> Has this been address in later version ? I'm still on rhel4.
>
>
>
> On Thu, Oct 8, 2009 at 2:25 AM, Sorin Sbarnea <[email protected]>wrote:
>
>> I found a similar limitation that does prevent me from using the
>> script in automaton in a proper way.
>> I cannot know from the returned code if the error is a permanent error
>> or a temporary error. For some errors retry will work: server busy,
>> concurrent access limitations but others are permanent like: login
>> denied for bad user/password.
>>
>> Also I found out that exit codes are not documented :(
>>
>> --
>> /sorin
>> http://nusunt.eu
>>
>> On Thu, Oct 8, 2009 at 09:00, stucky <[email protected]> wrote:
>> > Support
>> >
>> > Why does lftp exit with 0 here when it found no file to upload ?
>> >
>> > [cfern...@redford dev_test]$ /usr/bin/lftp -e 'set cmd:verbose yes; set
>> > net:max-retries 3; mput SCEA_FR_up.csv; exit;' -u user,xx
>> > sftp://my.host.com:23
>> > SCEA_FR_up.csv: no files found
>> > [cfern...@redford dev_test]$ echo $?
>> > 0
>> > [cfern...@redford dev_test]$
>> >
>> > How can I capture the correct exit code from mput ?
>> >
>> > Thanks for your help
>> > --
>> > stucky
>> >
>>
>
>
>
> --
> stucky
>



-- 
stucky

Reply via email to