On Fri, Jan 13, 2006 at 10:44:47AM -0500, Gene Heskett wrote:
> >> > and put "/media" into /.amanda.exclude on that host, but this
> >> You need to put "./media" into the exclude file.
> >Huh? How comes that this makes a difference on the root-filesystem?
>
> Perhaps the reason for that syntax needs to be repeated.
>
> Tar, in its traversal of a file system, looks at subdirs in the ./
> world, where the dot anchors it to the current directory. It does not
> look any further down the tree than the one its currently "cd'd" to.
Well, the confusing bit here is that tar does a _string_ comparison.
In the above case the DLE in question was the root-directory. In
filesystem semantics "/media" and "./media" is aequivalent as long as
you are cd'd into / (as it was in this case).
> It has no view of, or knowledge of, any file not in its currently being
> addressed directory.
But in this case "/media" actually _was_ in its currently addressed
directory. The real problem here is two-fold:
1. when creating an archive of the root-directory, gnutar (by default,
you can switch this off) prepends a dot to all path names. Gnutar
has a reason to do this, but that's a different story.
2. when matching for exclusion, tar ignores the fact that it has prepended
the dot, thus the match fails.
All that is no big deal. But I think it would be good to put a notice
into the man page that the paths should _always_ be given relative even
if the DLE in question is the root directory. I just re-read the man
page. There is no notice at all that they need to be given relatively.
|