From owner-freebsd-questions Tue Aug 1 9:47:39 2000 Delivered-To: freebsd-questions@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 16D3237B8A6 for ; Tue, 1 Aug 2000 09:47:34 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e71FoqC14993; Tue, 1 Aug 2000 08:50:52 -0700 (PDT) Date: Tue, 1 Aug 2000 08:50:52 -0700 From: Alfred Perlstein To: Matthew West Cc: Nathan Vidican , questions@FreeBSD.ORG Subject: Re: excluding a file/dir from a tar file Message-ID: <20000801085052.P4854@fw.wintelcom.net> References: <3986BD05.3D19504D@wmptl.com> <20000801142223.A93938@apotheosis.org.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <20000801142223.A93938@apotheosis.org.za>; from mwest@uct.ac.za on Tue, Aug 01, 2000 at 02:22:24PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Matthew West [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