On Tue, 2005-08-02 at 12:42 -0500, Shawn Fertch wrote:
> On 8/2/05, Nate Carlson <tclug at natecarlson.com> wrote:
> > Debian man pages:
> > 
> >         --exclude=PATTERN
> >                exclude files matching PATTERN
> >         -X, --exclude-from=FILE
> >                exclude files matching patterns listed in FILE
> > 
> > Apparently, that's where it's coming from.
> > 
> > Have you tried specifying your exclude's first thing?
> > 
> > IE,
> > 
> > tar --exclude /proc -cpf /dev/st0 --directory / .
> > 
> > I just tried:
> > tar --exclude /proc -czvf blah.tar /proc /boot
> > 
> > and it excluded /proc successfully. (Debian's tar, again.)
> 
> That was it.  I had them out of order, and it seems to be working at the moment.

Heh, it's worth noting that we're talking about at least two, and
possibly three different upstream versions of tar here, and each of them
probably has distro-specific patches added on to that.  For instance,
the Debian man page is different because of their patch (see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=146196), which in part
makes the man page consistent with the info page, apparently.  (The info
page for the version of tar on Slackware 10.1 shows the syntax that Nate
mentions above).

I'm running Debian testing, and I've got tar 1.14 (er, 1.14-2 in
Debian-speak), and that's probably the same thing that's in Sarge (the
current stable release).  A search at rpmfind.net indicates that RHEL
comes with tar 1.13.25-13, while the Slackware website says 10.1 has tar
1.15.1.

I actually tried a command similar to Shawn's original tar command (with
parameters in basically the same sequence), and it seems to work okay:

        [mike at 3po][~]$ find foo
        foo
        foo/bar
        foo/baz
        foo/ook
        foo/var
        foo/usr
        foo/proc
        foo/sys
        foo/mnt
        [mike at 3po][~]$ tar cvf foo.tar --directory foo --exclude proc --exclude mnt .
        ./
        ./bar/
        ./baz/
        ./ook/
        ./var/
        ./usr/
        ./sys/

So maybe this is just a tar 1.13.x issue?  Glancing through Debian's
patch, I didn't see anything changing the actual exclude code, just the
manual page.  Conversely, I suppose tar 1.15.x could have gotten more
picky...

-- 
Mike Hicks <hick0088 at tc.umn.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://shadowknight.real-time.com/pipermail/tclug-list/attachments/20050802/00176b83/attachment.pgp