Operating System - HP-UX
1827288 Members
3270 Online
109717 Solutions
New Discussion

Re: the return code of tar command

 
Chen Yingjie
Frequent Advisor

the return code of tar command

Could someone advise me
the return code of tar command?

Thanks
9 REPLIES 9
Michael Tully
Honored Contributor

Re: the return code of tar command

Hi,

What exact message are you receiving. 'tar' issues it's own error messages. This is explained in the man page.

Regards
Michael
Anyone for a Mutiny ?
Christian Gebhardt
Honored Contributor

Re: the return code of tar command

Hi

exit(0)
no error & no warning.

exit(1)
Tar: cannot create temporary file (%s)
Invalid blocksize. (Max %d)
tar: blocksize %d too big, can't get memory
tar:Invalid or non-existent device file %s
Can only create standard output archives
tar: cannot open %s
tar: option not supported for this device %s
tar: cannot write to %s: write protected
tar: usage tar [-]{txruc}[eONvVwAfblhm{op}][0-7[lmh]] ......
Attempt to create archive of no files. Nothing dumped.
tar: cannot preserve extent attributes for %s. aborting...
Tar: cannot create temporary file (%s)
Invalid blocksize. (Max %d)
tar: blocksize %d too big, can't get memory
tar:Invalid or non-existent device file %s
Can only create standard output archives

exit(2)
directory checksum error
tar: %s: HELP - extract write error
tar: Cannot close %s
Tar: tape write error

exit(3)
Tar: tape read error
Tar: tape blocksize error
Tar: blocksize = 0; broken pipe?
Tar: error! blocksize changed

exit(4)
Tar: tape backspace error
Tar: ioctl to write filemarks failed (%d). aborting...
Tar: ioctl to determine device online failed. aborting...

exit(5)
tar: Cannot change directory to '%s'
tar: Path '%s' skipped
tar: cannot open %s
Missing links to %s
tar: %s: cannot access file
tar: Out of memory. Cannot detect symbolic link loops
tar: Loop of symbolic links detected, tar terminated
tar: cannot stat %s. Not dumped.
tar: Size of %s > %s. Not dumped.
tar: %s: directory read error
tar: %s: directory read error
tar: %s: symbolic link too long
tar: can't read symbolic link
tar: %s: cannot open file
tar: %s: link to name too long
Out of memory. Link information lost
%s: file changed size
tar: %s is not a file. Not dumped
tar: %s: symbolic link failed
%s: cannot link
tar: %s couldn't create character device
tar: %s couldn't create block device
tar: %s couldn't create fifo
tar: %s couldn't create directory
tar: %s couldn't create directory
tar: %s - cannot create
tar: chmod failed
tar: chown failed
tar: couldn't get uname for uid %d
tar: couldn't get gname for gid %d
tar: pwd failed
tar: %s: pathname too long
tar: %s: prefix too long
tar: %s: file name too long
%s: file name too long

Chris
Alexander M. Ermes
Honored Contributor

Re: the return code of tar command

Hi there.
I think, that there might be a different idea.
You create a tar-file with tar cvf target source.

tar -cvf my_project.TAR my_project

If you want the files in the tar archive shown do this :

tar -tvf my_project.TAR

If you want to extract the files do this :

tar -xvf my_project.TAR

But be careful, that you work in the right directory.

;-)

Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Alexander M. Ermes
Honored Contributor

Re: the return code of tar command

Hi there.
I think, that there might be a different idea.
You create a tar-file with tar cvf target source.

tar -cvf my_project.TAR my_project

If you want the files in the tar archive shown do this :

tar -tvf my_project.TAR

If you want to extract the files do this :

tar -xvf my_project.TAR

But be careful, that you work in the right directory.

;-)

Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Alexander M. Ermes
Honored Contributor

Re: the return code of tar command

Hi there.
I think, that there might be a different idea.
You create a tar-file with tar cvf target source.

tar -cvf my_project.TAR my_project

If you want the files in the tar archive shown do this :

tar -tvf my_project.TAR

If you want to extract the files do this :

tar -xvf my_project.TAR

But be careful, that you work in the right directory.

;-)

Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Chen Yingjie
Frequent Advisor

Re: the return code of tar command

Thanks for your reply.
Alexander M. Ermes
Honored Contributor

Re: the return code of tar command

Hi there.
I think, that there might be a different idea.
You create a tar-file with tar cvf target source.

tar -cvf my_project.TAR my_project

If you want the files in the tar archive shown do this :

tar -tvf my_project.TAR

If you want to extract the files do this :

tar -xvf my_project.TAR

But be careful, that you work in the right directory.

;-)

Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Alexander M. Ermes
Honored Contributor

Re: the return code of tar command

Sorry for three times the same answer.
Reply was HTTP 404 page not found so i did it again.
Rgds
Alexander M. Erms
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Ravi_8
Honored Contributor

Re: the return code of tar command

Hi,

if the tar retuns 0 then command is successfully executed, other than 0 command failed.
never give up