1834935 Members
2179 Online
110071 Solutions
New Discussion

Re: gnu tar help

 
T G Manikandan
Honored Contributor

gnu tar help

tar --version
tar (GNU tar) 1.13

I am trying to archive files greater then 256 chars using gnu tar.

When I extract the same file gets extracted with zero bytes.
Even the link the file is associated is not properly restored.

x ././@LongLink, 250 bytes, 1 tape blocks
tar: ././@LongLink - cannot create
x 1oerrepqoprewporewkfdalkfaslklfdsasaklfdsklkflasioreqwioreqwiourieoqreuoireaio
sfasfauoiuoifoiasoifu symbolic link to /home1/c210/dsrini/chummatest/chummatest/
chummatest/chummatest/chummatest/chummatest/chummatest/chu


How to proceed?


Thanks
2 REPLIES 2
U.SivaKumar_2
Honored Contributor

Re: gnu tar help

Hi,
problem seems to be the symbolic links in your
directory.

ref:
Normally, when tar archives a symbolic link, it writes a block to the archive naming the target of the link. In that way, the tar archive is a faithful record of the filesystem contents. --dereference (-h) is used with --create (-c), and causes tar to archive the files symbolic links point to, instead of the links themselves. When this option is used, when tar encounters a symbolic link, it will archive the linked-to file, instead of simply recording the presence of a symbolic link.

The name under which the file is stored in the file system is not recorded in the archive. To record both the symbolic link name and the file name in the system, archive the file under both names. If all links were recorded automatically by tar, an extracted file might be linked to a file name that no longer exists in the file system.

If a linked-to file is encountered again by tar while creating the same archive, an entire second copy of it will be stored. (This might be considered a bug.)

So, for portable archives, do not archive symbolic links as such, and use --dereference (-h): many systems do not support symbolic links, and moreover, your distribution might be unusable if it contains unresolved symbolic links

regards,
U.SivaKumar

Innovations are made when conventions are broken
T G Manikandan
Honored Contributor

Re: gnu tar help

back to top