1830169 Members
4875 Online
109999 Solutions
New Discussion

Tar exit codes

 
Mac_minator
New Member

Tar exit codes

Can someone give me the list of tar exit codes?
This is for standard /bin/tar.
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: Tar exit codes

Hi:

You can probably rely on 0=success; 1=failure in keeping with all standard Unix utilities. Otherwise, 'tar' reports errors with messages.

Regards!

...JRF...
Steven Schweda
Honored Contributor

Re: Tar exit codes

> This is for standard /bin/tar.

Too bad. The documentation for GNU "tar"
seems to be better along this axis.

http://www.gnu.org/software/tar/manual/
http://www.gnu.org/software/tar/manual/html_node/tar_33.html#IDX28
Dennis Handly
Acclaimed Contributor

Re: Tar exit codes

>JRF: You can probably rely on 0=success; 1=failure in keeping with all standard Unix utilities.

Don't you mean >0 or non-zero is failure? That's what rm(1) and mkdir(1) say.
whiteknight
Honored Contributor

Re: Tar exit codes


Hi Mac,


You should concentrate on the error message accompanying the non-zero exit code

WK
Problem never ends, you must know how to fix it
William Donnelly
New Member

Re: Tar exit codes

On my HP system, tar exits with a variety of exit codes (right now, I'm getting an exit code of "5"). I think what folks are asking for is an explanation of what each error code means, specifically. The tar command might be buried inside a massive build script or something, where the actual output is not readily available.
Dennis Handly
Acclaimed Contributor

Re: Tar exit codes

>William: tar exits with a variety of exit codes (right now, I'm getting an exit code of 5). I think what folks are asking for is an explanation of what each error code means

Since they aren't documented, you can't attach any meaning to the different exit status.
(You didn't see this but from the source 5 means only non-fatal errors occurred.)