bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] bug: gtar --exclude breaks hard links


From: La Monte H.P. Yarroll
Subject: [Bug-tar] bug: gtar --exclude breaks hard links
Date: Wed, 02 Feb 2005 11:03:05 -0500
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

I don't have a fix for this problem, but it is causing me a lot of
grief.  When tar is extracting files from an archive with --exclude,
it fails to account for hard links pointed at the same file.

address@hidden:~/lab/gtar> tar --version
tar (GNU tar) 1.13.25
Copyright © 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
address@hidden:~/lab/gtar> mkdir foo
address@hidden:~/lab/gtar> touch foo/bar
address@hidden:~/lab/gtar> ln foo/bar foo/frob
address@hidden:~/lab/gtar> ls -lia foo
total 0
3880516 drwxr-xr-x  2 piggy piggy 96 2005-02-02 10:18 .
3880492 drwxr-xr-x  3 piggy piggy 72 2005-02-02 10:18 ..
3880517 -rw-r--r--  2 piggy piggy  0 2005-02-02 10:18 bar
3880517 -rw-r--r--  2 piggy piggy  0 2005-02-02 10:18 frob
address@hidden:~/lab/gtar> tar cfv foo.tar foo
foo/
foo/bar
foo/frob
address@hidden:~/lab/gtar> rm -rf foo
address@hidden:~/lab/gtar> tar tfv foo.tar
drwxr-xr-x piggy/piggy       0 2005-02-02 10:18:25 foo/
-rw-r--r-- piggy/piggy       0 2005-02-02 10:18:19 foo/bar
-rw-r--r-- piggy/piggy       0 2005-02-02 10:18:19 foo/frob link to foo/bar
address@hidden:~/lab/gtar> tar xfv foo.tar --exclude foo/bar
foo/
foo/frob
tar: foo/frob: Cannot hard link to `foo/bar': No such file or directory
tar: Error exit delayed from previous errors
address@hidden:~/lab/gtar>

Ideally, I'd like to see foo/bar extracted as foo/frob.  Failing that,
I'd like to like to make --exclude transitive.  Tracking down all the
hard links which go with an excluded file outside of tar is painful.

It would be really nice if I could tell tar to break hard links when
creating the tar file ala --dereference for symbolic links or the
default behavior of cpio.

I'm trying to create a single tar file which I can extract (mostly)
onto to different filesystems with mutually incompatable file naming
constraints.  I'm content to lose a few files because of bad names.

--
 Anyone who quotes me in their sig is an idiot. -- Rusty Russell's sig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]