From owner-freebsd-questions@FreeBSD.ORG Fri Jul 8 05:08:18 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97B0916A41C for ; Fri, 8 Jul 2005 05:08:18 +0000 (GMT) (envelope-from cdelsey@qwest.net) Received: from mpls-qmqp-04.inet.qwest.net (mpls-qmqp-04.inet.qwest.net [63.231.195.115]) by mx1.FreeBSD.org (Postfix) with SMTP id 32BE443D45 for ; Fri, 8 Jul 2005 05:08:18 +0000 (GMT) (envelope-from cdelsey@qwest.net) Received: (qmail 53028 invoked by uid 0); 8 Jul 2005 05:07:28 -0000 Received: from unknown (63.231.195.4) by mpls-qmqp-04.inet.qwest.net with QMQP; 8 Jul 2005 05:07:28 -0000 Received: from vdsl-130-13-179-246.phnx.qwest.net (HELO ?192.168.2.2?) (130.13.179.246) by mpls-pop-04.inet.qwest.net with SMTP; 8 Jul 2005 05:08:11 -0000 Received: by localhost.local (Postfix, from userid 1001) id 62D634432; Thu, 7 Jul 2005 22:08:10 -0700 (MST) Date: Thu, 7 Jul 2005 22:08:10 -0700 Message-ID: <20050708050810.GA9585@localhost.local> From: "Carl Delsey" To: "FreeBSD Questions" Mail-Followup-To: FreeBSD Questions References: <42CDF112.5070209@mykitchentable.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42CDF112.5070209@mykitchentable.net> User-Agent: Mutt/1.4.2.1i Subject: Re: tar Syntax Help 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: Fri, 08 Jul 2005 05:08:18 -0000 Try leaving off the leading / from each line in your exclude list. I think what is happening is that, by default, tar drops the leading / from each file it tars up so that when you untar, it extracts all files relative to the current directory. I think because of this, when you specify absolute paths in your exclude file, tar fails to match them. Alternatively, if you want to keep the absolute paths, try tar with the -P option. Your exclude list may work as is in that case. I haven't ever tried that myself though. Just be careful when you untar if you do use that switch. Carl On Thu, Jul 07, 2005 at 08:20:50PM -0700, Drew Tomlinson wrote: > I'm trying to copy an entire file system while using an exclude file to > avoid copying things such as /dev, /proc, etc. I've read the man page > and found the -X or --exclude-from tar option. I've create a file > called /exclude.list. It contains lines such as: > > /exclude.list > /dev > /proc > > But I can't figure out how to form the correct command line. I > basically want to do this: > > tar -cvf - --exclude-from /exclude.list -C / . | tar xpf - -C . > > I've search the web and found examples that look similar to the above > but this does not work for me. tar attempts to copy /dev and I get all > the associated errors. I've tried other placements of either "-X", "X", > and "--exclude from" on the command line various things happen from it > just being ignored to tar thinking I want to create and archive named > "-X", etc., to tar trying to add a file named "-X", etc. to the current > archive. I'm at a loss. > > I'm using 4.11 and trying to make a good backup before upgrading to > 5.4. Can anyone tell me the secret incantation to make this work? > > Thanks, > > Drew > > -- > Visit The Alchemist's Warehouse > Magic Tricks, DVDs, Videos, Books, & More! > > http://www.alchemistswarehouse.com > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >