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
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to