1833883 Members
1978 Online
110063 Solutions
New Discussion

Re: Problems with tar

 
Scott Brewster
New Member

Problems with tar

We have Tru64 and HPUX unix boxes here. Occassionally, we need to move files from Tru64 to HPUX. This is usually done via tar and ftp. We recently ran in to this situation:

The following from a Tru64 system is tarred up:
subdir/
subdir/subdir2/
subdir/subdir2/testfile2
subdir/testfile1

The resulting tar file works on all other Tru64 boxes when untarring it. IE: it creates the directories and files as expected. On any other HPUX system, we get:
tar: ./subdir - cannot create
./subdir not a directory

Everything under that subdir fails with the same or similar error. Has anyone run into this when moving a tar from from Tru64 to HPUX? If so, what causes it? More importantly, what fixes it?

scott

ps this happens on our 10.20 and 11i systems.
6 REPLIES 6
Michael Tully
Honored Contributor

Re: Problems with tar

Off hand, how is the tar archive created and attempted to be extracted? Are you using 'root'?
Anyone for a Mutiny ?
Scott Brewster
New Member

Re: Problems with tar

The tar is being done (both as root and as Joe User) like this:

tar -cf /tmp/sdb.tar ./ (to get entire current directory and below).

Have also tried:

tar -cf /tmp/sdb.tar ./perl (to get perl subdir and all below it (only)).

the tar completes successfully with either command. The restore command looks like this:

tar -xf sdb.tar

During this restore is when the previously mentioned errors pop up (whether as root or plain user).

A tar -tf sdb.tar shows that the tar file contains the subdirs and files as expected.
avsrini
Trusted Contributor

Re: Problems with tar

Hi Scott,
Can you check the permission of the parent dir. Do you have access to create files / sub-dirs under the dir, in which you are tring you extract the tar image.

Also check with the following.

Use tar -cf /tmp/name.tar * (* instead of ./).

Srini.
Be on top.
Michael Steele_2
Honored Contributor

Re: Problems with tar

What do you see when you read the table of contents on the tape?

tar -tvf /dev/rmt/0m

Regarding the above suggestion to use relative backups instead of absolute:

absolute = /dir/file
relative - ./dir/file

Just remember that when you restore absolute you'll also overwrite.

Try working with PAX. PAX is the ignite backup utility and works with TAR and CPIO as well. Also, it has the nice feature of a relative restore with an absolute backup:

pax -r -s,/home/users,/home/users2, -f /tmp/users.tar

Finally, beyond a permission problem on the directory somewhere, I don't see why this should be happening. :-(
Support Fatherhood - Stop Family Law
Michael Tully
Honored Contributor

Re: Problems with tar

I tried to reproduce this problem and could not on two systems, one being an AIX box (don't have a TRU64).
Anyone for a Mutiny ?
Michael Tully
Honored Contributor

Re: Problems with tar

I tried to reproduce this problem and could not on two systems, one being an AIX box (don't have a TRU64). As suggested, perhaps try a different method, like 'cpio' or dd
Anyone for a Mutiny ?