Discussion:
lftp Exit code when using mget
T***@bertelsmann.de
2014-04-15 13:33:24 UTC
Permalink
Hi,
how can we poll a remote server using "mget *" for files, to not fail if there are no files available?

"set cmd:fail-exit yes;" is always set in our environment to detect any issues occurring, but in this case we only want that "mget *" is ok, when no files are available. Any other error during "mget *" should cause lftp to end with RC != 0. Is this possible to implement somehow?

Thanks and regards,
Tilo
Alexander Lukyanov
2014-06-06 16:03:21 UTC
Permalink
I could add an option for mget, but also it is also possible to use mirror
command instead. Please consider if it is really possible in your case.
Hi,
how can we poll a remote server using “mget *” for files, to not fail if
there are no files available?
“set cmd:fail-exit yes;” is always set in our environment to detect any
issues occurring, but in this case we only want that “mget *” is ok, when
no files are available. Any other error during “mget *” should cause lftp
to end with RC != 0. Is this possible to implement somehow?
Thanks and regards,
Tilo
_______________________________________________
lftp mailing list
http://univ.uniyar.ac.ru/mailman/listinfo/lftp
--
Alexander.
T***@bertelsmann.de
2014-06-10 12:38:06 UTC
Permalink
OK, thanks for the suggestion with the mirror command. I think it will work this way.

Anyway, my suggestion: Maybe this could be implemented with an global lftp switch which affects all protocols:
xfer:mget-error-no-file

If set to false, it doesn’t throw an error when no file is found. And the default is true (as it works today).

Regards,
Tilo

From: Alexander Lukyanov [mailto:***@gmail.com]
Sent: Friday, June 06, 2014 6:03 PM
To: MÃŒtze, Tilo, NMD-C4.2
Cc: Lista LFTp
Subject: Re: [lftp] lftp Exit code when using mget

I could add an option for mget, but also it is also possible to use mirror command instead. Please consider if it is really possible in your case.

2014-04-15 17:33 GMT+04:00 <***@bertelsmann.de<mailto:***@bertelsmann.de>>:
Hi,
how can we poll a remote server using “mget *” for files, to not fail if there are no files available?

“set cmd:fail-exit yes;” is always set in our environment to detect any issues occurring, but in this case we only want that “mget *” is ok, when no files are available. Any other error during “mget *” should cause lftp to end with RC != 0. Is this possible to implement somehow?

Thanks and regards,
Tilo


_______________________________________________
lftp mailing list
***@uniyar.ac.ru<mailto:***@uniyar.ac.ru>
http://univ.uniyar.ac.ru/mailman/listinfo/lftp
--
Alexander.
Alexander V. Lukyanov
2014-06-10 13:30:35 UTC
Permalink
Post by T***@bertelsmann.de
OK, thanks for the suggestion with the mirror command. I think it will work this way.
xfer:mget-error-no-file
If set to false, it doesn’t throw an error when no file is found. And the default is true (as it works today).
The next version will have this:

glob --exist * && mget *
--
Alexander.
Loading...