Skip to content
Advertisement

Does tar exit code 123 always mean empty archive?

JavaScript

The tar man page only documents return codes 0, 1, and 2 but explains further:

If a subprocess that had been invoked by tar exited with a nonzero exit code, tar itself exits with that code as well. This can happen, for example, if a compression option (e.g. -z) was used and the external compressor program failed. Another example is rmt failure during backup to a remote device.

So I assume this return code “123” comes from some invoked subprocess.

Question: Does tar exit code 123 always mean empty archive? (what subprocess returns this code?)

What I have tried:

1) The only thing I could think of was to strace this, but I’m not experienced enough with it to tell if its output reveals the answer to my question.

JavaScript

Is the above the correct way to run strace on tar? In any case, the command had no output.

I can include the output of the above without the final grep if relevant, but I’m excluding it for now because it’s long, and it’s not clear to me that it’s necessarily useful

2) Searched SO, the closest hit I found was this, but I’m not sure that that’s relevant (not clear to me that find/xargs is involved in the return code of “123“)

Advertisement

Answer

From man xargs:

JavaScript

Thus, any nonzero exit status from tar will cause xargs tar to use status 123.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement