From owner-freebsd-questions@FreeBSD.ORG Tue May 18 13:52:59 2010 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 D087B1065673 for ; Tue, 18 May 2010 13:52:59 +0000 (UTC) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.103.93]) by mx1.freebsd.org (Postfix) with ESMTP id A19C58FC0A for ; Tue, 18 May 2010 13:52:59 +0000 (UTC) Received: from dc.cis.okstate.edu (localhost.cis.okstate.edu [127.0.0.1]) by dc.cis.okstate.edu (8.14.2/8.13.8) with ESMTP id o4IDqa5g072372 for ; Tue, 18 May 2010 08:52:40 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <201005181352.o4IDqa5g072372@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Date: Tue, 18 May 2010 08:52:36 -0500 From: Martin McCormick Subject: tar with --include Gets Much More. 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: Tue, 18 May 2010 13:52:59 -0000 The FreeBSD man page for tar shows --include pattern (-W include=pattern) Process only files or directories that match the specified pat- tern. Note that exclusions specified with --exclude take prece- dence over inclusions. If no inclusions are explicitly speci- fied, all entries are processed by default. This sounded useful in what one might do when rebuilding a name server, for example. One could tar only that part of /var containing the /var/named directory so I tried: tar cvf tst.tar /var --include named and tar cvf tst.tar /var --include='* named*' tar: Removing leading '/' from member names a var a var/account a var/at a var/audit a var/backups a var/crash a var/cron a var/db a var/empty a var/heimdal a var/log I was expecting only /var/named/[all those files] The goal is to tar only /var/named, /var/log, /var/cron and /var/at such that one could take the resulting tar file and unpack it over the new /var. I was under the impression from the man page that --include's caught only what was named in the pattern and --exclude's passed everything but the pattern. I think the --exclude directive has worked before but --include is either not doing anything or works completely differently that what I was expecting. Any ideas are appreciated. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group