From owner-freebsd-questions@FreeBSD.ORG Thu Aug 30 15:49:06 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3275D16A41A for ; Thu, 30 Aug 2007 15:49:06 +0000 (UTC) (envelope-from cyberleo@cyberleo.net) Received: from pizzabox.cyberleo.net (alpha.cyberleo.net [198.145.45.10]) by mx1.freebsd.org (Postfix) with ESMTP id EC79013C4A6 for ; Thu, 30 Aug 2007 15:49:05 +0000 (UTC) (envelope-from cyberleo@cyberleo.net) Received: (qmail 33145 invoked from network); 30 Aug 2007 15:49:05 -0000 Received: from adsl-75-3-87-131.dsl.chcgil.sbcglobal.net (HELO ?172.16.44.14?) (cyberleo@cyberleo.net@75.3.87.131) by alpha.cyberleo.net with ESMTPA; 30 Aug 2007 15:49:05 -0000 Message-ID: <46D6E6E9.4030007@cyberleo.net> Date: Thu, 30 Aug 2007 10:48:57 -0500 From: CyberLeo Kitsana User-Agent: Thunderbird 2.0.0.6 (X11/20070819) MIME-Version: 1.0 To: Jim Stapleton References: <80f4f2b20708300758v56c71856u1ce737a0a2caff9e@mail.gmail.com> In-Reply-To: <80f4f2b20708300758v56c71856u1ce737a0a2caff9e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions Subject: Re: file patterns and tar X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Aug 2007 15:49:06 -0000 Jim Stapleton wrote: > I want to create a backup of some parts of my system, but not everything > > ex, I want to exclude /bin, and /usr/bin, but not /usr/local/bin - > same for *sbin, *lib, and *libexec > > however, if I used > > tar -jcvf test.tbz \ > --exclude /bin --exclude /usr/bin \ > --exclude /dev --exclude /var --exclude /tmp \ > --exclude /root --exclude /proc / | \ > tar -tf - | grep bin > > I don't get /usr/local/bin files. > > I coudln't find more help in tar, either through tar --help or man > tar, though I know it says that it is excluding leading slashes in > file names (which is probably causing this issue). What should I do, > short of running tars for /, /usr/ and /usr/local, or is that the only > real option? But then there is always the possiblility of missing > something because its name just happens to contain bin, or more likely > contains lib. If you're going for really wacky patterns, and don't mind wrestling with find(1), you could always pipe the output of find into tar: find Pictures -type f -name '*.jpg' -print0 | tar cvTf - jpegs.tar --null -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net Furry Peace! - http://wwww.fur.com/peace/