Date: Tue, 01 Aug 2000 09:56:32 -0500 From: Oscar Ricardo Silva <oscars@mail.utexas.edu> To: freebsd-questions@freebsd.org Subject: Re: excluding a file/dir from a tar file Message-ID: <4.3.2.7.2.20000801095313.00b48760@mail.utexas.edu> In-Reply-To: <20000801142223.A93938@apotheosis.org.za> References: <3986BD05.3D19504D@wmptl.com> <3986BD05.3D19504D@wmptl.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <tar file to be created> <exclude flags> <files to be tarred> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.3.2.7.2.20000801095313.00b48760>