APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS











(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Home > News Posts > tar exit codes OSR5
Printer Friendly Version




News Group Posts

tar exit codes OSR5




Subject: Re: tar exit values (return codes)
From: spcecdt@deeptht.armory.com (John DuBois)
Date: Thu, Mar 27, 2003 7:53 PM

In article <3E82E922.2000008@infotop.co.uk>,
Ian Wilson  <scobloke2@infotop.co.uk> wrote:
>
>Ian Wilson wrote:
>
>> For 'tar cf /dev/rSt0' in OSR505 I find that return codes are as follows
>>   0 when no problems occurred.
>>   6 when no tape in drive.
>>  16 when someone else is using the device.
>> 
>> is there a full list of return codes and meanings?

Unfortunately, no.



>143 when tar is SIGTERMed
>5 when tape is write protected
>130 when tar is INTERRUPTed
>Empiric methods can be so slow!
>
>Stand by whilst I discover the exit code for "tape drive on fire" ...

Values over 128 represent the OR'ing of 128 with a signal that killed tar (or
any other program).  SIGINT = 2; 128 + 2 = 130; SIGTERM = 15 ...

Skimming the tar source turns up these exit codes:

0 - success
1 - bad directory tree, failed to extract a requested file,
    input file same as output file, failed to open input file,
    could not create link, link table malloc  failure
2 - internationalization error that should never occur,
    checksum error
5 - checksum error
9 (EBADF) - error reading /etc/default/tar, misplaced end of volume
12 (ENOMEM) - failure to allocate memory for buffer
22 (EINVAL) - bad invokation (argument syntax errors),
    bad parameters to options
28 (ENOSPC) - file too large for a volume
78 (ENAMETOOLONG) - cwd name too long
171 (ETOAST) - tape drive on fire
fork()/execl() errno if /bin/pwd & /usr/bin/pwd cannot be executed (unlikely)
pipe(), fork(), and execl() errnos for problems in creating pipe to compressor
read()/write() errno - tape read/write error
fopen() errno - failure to create tempfile
creat() errno - could not create output file
write() errno - failure to write extracted file
mkdir() errno - failure to make directory
dup()/open() errno - failure to reopen input/output
lseek()/reak() errno - failure to seek/skip on archive
fopen(), fread() errno - failure to read from file list file

You got 5 for a write-protected tape because that's the errno EIO (I/O error).

        John
-- 
John DuBois  spcecdt@armory.com  KC6QKZ/AE  http://www.armory.com/~spcecdt/
 

If this page was useful to you, please click to help others find it:  

Your +1's can help friends, contacts, and others on the web find the best stuff when they search.

3 comments



Click here to add your comments





Fri Jul 30 21:43:24 2010:   Mike
http://www.mikeskramstad.com
gravatar
Tar is exiting with 64. What does it mean?

http://www.20below.net Polar Fleece Clothing



Fri Jul 30 23:23:15 2010:   TonyLawrence

gravatar
Unknown tar on an unknown operating system. How would we know? If you have source, look it up.



Tue Nov 15 06:48:07 2011:   ShellyS

gravatar
I received the exit code 64 also. In my case, I found out that the tar command failed because the first file in my archive started with '-', and tar apparently saw that as another command line option. To resolve my issue, I added '--' to the tar command like so:
tar cvf mybackup.tar -- *

The '--' tells the tar command that no more command line options are coming.

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



LOD Communications, Inc.

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.

g_face.jpg

This post tagged:

       - SCO_OSR5




Unix/Linux Consultants

Skills Tests

Guest Post Here