Tar Exclude?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Lynn David Newton
Date:  
Subject: Tar Exclude?
> tar cv --exclude=/var/tmp/directory-to-exclude/* -f var.tar /var

As someone else correctly noted, the problem is that an
unquoted asterisk will be interpreted as a
metacharacter by the shell before passing it to tar.
The suggestion was made to put just the * in single
quotes. I think that works, but strikes me as a weird
way to do it. I would quote the whole argument in
double quotes, from after the = sign through and
including the asterisk.

--
Lynn David Newton
Phoenix, AZ