From owner-freebsd-questions Tue Aug 1 7:59:38 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail.utexas.edu (wb1-a.mail.utexas.edu [128.83.126.134]) by hub.freebsd.org (Postfix) with SMTP id 0249F37BF15 for ; Tue, 1 Aug 2000 07:59:35 -0700 (PDT) (envelope-from oscars@mail.utexas.edu) Received: (qmail 26744 invoked by uid 0); 1 Aug 2000 14:59:33 -0000 Received: from chepe.cc.utexas.edu (HELO chepe.mail.utexas.edu) (128.83.135.25) by umbs-smtp-1 with SMTP; 1 Aug 2000 14:59:33 -0000 Message-Id: <4.3.2.7.2.20000801095313.00b48760@mail.utexas.edu> X-Sender: oscars@mail.utexas.edu X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Tue, 01 Aug 2000 09:56:32 -0500 To: freebsd-questions@freebsd.org From: Oscar Ricardo Silva Subject: Re: excluding a file/dir from a tar file In-Reply-To: <20000801142223.A93938@apotheosis.org.za> References: <3986BD05.3D19504D@wmptl.com> <3986BD05.3D19504D@wmptl.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG You may also want to exclude based on a list of files/directories kept in a file. From the tar man page: [ --exclude FILE ] [ -X, --exclude-from FILE ] so you could use "--exclude FILE" to exclude a single file, or you could put all you want to exclude in a text file and use: tar -X, /EXCLUDEFILE ... As for the order of the flags, it's tar -flags -f Oscar /bin/tar -cvf /dev/st0 -X /usr/local/bin/EXCLUDE / At 02:22 PM 8/1/00 +0200, Matthew West, you 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 / > > Seeing as how rm doesn't like filenames with a '-' prepended to > > them, I've been having some difficulty trying to clean uo 600~meg > > '--exclude' files from my system. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message