Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Aug 2000 08:50:52 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Matthew West <mwest@uct.ac.za>
Cc:        Nathan Vidican <webmaster@wmptl.com>, questions@FreeBSD.ORG
Subject:   Re: excluding a file/dir from a tar file
Message-ID:  <20000801085052.P4854@fw.wintelcom.net>
In-Reply-To: <20000801142223.A93938@apotheosis.org.za>; from mwest@uct.ac.za on Tue, Aug 01, 2000 at 02:22:24PM %2B0200
References:  <3986BD05.3D19504D@wmptl.com> <20000801142223.A93938@apotheosis.org.za>

next in thread | previous in thread | raw e-mail | index | archive | help
* Matthew West <mwest@uct.ac.za> [000801 04:31] wrote:
> On Tue, Aug 01, 2000 at 08:05:25AM -0400, Nathan Vidican wrote:
> > I know the flag is --exclude, but where exactly do I put the flag in?
> > Could someone post an example of a working version of this:
> > 
> > tar cvzf --exclude /server --exclude /mail /server/master.tgz /
> 
> The -f flag takes the argument immediately after it to be the filename, whcih
> is why you're ending up with "--exclude" tar files.
> 
> This should work:
> 
> tar -cvzf /server/master.tgz --exclude /server --exclude /mail /
> or even
> tar -cvz --exclude /server --exclude -f /server/master.tgz / 

Just a non-obvious observation, I'm quite certain that you can't
mix the non '-' flags with '--' flags:

tar czvf file.tgz --exclude /server /path
won't work, while:
tar -czvf file.tgz --exclude /server /path
should.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000801085052.P4854>