I am not sure about on how to specify that a second command should only be execute in case
that the first command fails/succeeds.

When I enter:

cmd1 | gzip -f ... && cmd2

Is then cmd2 executed only if cmd1 is finished successfully or if gzip is finished successfully?

Is the command concatenation "&&" correct at all?

What if I want cmd2 only to execute if both (cmd1 and gzip) end successfully?

What about the other way: cmd2 should only be executed if

a) cmd1 failed

b) cmd1 or gzip failed?

Matthew