Discussion:
Suggestion for improvement for LFTP
vasos g
2014-02-03 12:59:07 UTC
Permalink
Hello,
First of all thanks for this great file uploading program.

I am using to reliably upload files with a method I call "mv&rm". It
merely consists of: a) upload to a staging area. b) move prod to a
templocation c) move stage to prod. d) rm templocation. I suppose you
can imagine possible uses of this. One thing that I suggest is to
implement this feature, which is something involving a lot of work I
suppose.

Besides this, I can implement this behavior with a lftp script.
Another thing that I need, in order to implement this behaviour via an
lftp script is the ability to execute a group of commands conditionally
when a command fails. I want this to happen not in a subshell (as the
"(") because I want to call "exit top".
E.g.
command || { echo "FAILED command"; exit top; }


OR I want an exit command that when invoked from a subshell, it will
exit the parent shell as well;
E.g.
command || ( echo "FAILED command; exit parent; )

By the way shouldn't exit top accomplish this ?



Thanks
V.G
Alexander V. Lukyanov
2014-02-14 12:59:37 UTC
Permalink
Post by vasos g
I am using to reliably upload files with a method I call "mv&rm". It
merely consists of: a) upload to a staging area. b) move prod to a
templocation c) move stage to prod. d) rm templocation. I suppose
you can imagine possible uses of this. One thing that I suggest is
to implement this feature, which is something involving a lot of
work I suppose.
I think this operation can vary greatly and can be implemented as a script.
Post by vasos g
Besides this, I can implement this behavior with a lftp script.
Another thing that I need, in order to implement this behaviour via
an lftp script is the ability to execute a group of commands
conditionally when a command fails. I want this to happen not in a
subshell (as the "(") because I want to call "exit top".
Please try attached patch which improves "exit" behavoir and also
adds "exit parent".

Thus these commands work as expected:
((echo aaa; exit) echo bbb)
((echo aaa; exit parent) echo bbb)
((echo aaa; exit top) echo bbb)

--
Alexander.

Loading...