Date: Tue, 18 May 2010 08:52:36 -0500 From: Martin McCormick <martin@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Subject: tar with --include Gets Much More. Message-ID: <201005181352.o4IDqa5g072372@dc.cis.okstate.edu>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005181352.o4IDqa5g072372>