[CentOS] tar exclude command

Thu Jan 7 15:13:53 UTC 2010
Luciano Rocha <strange at nsk.no-ip.org>

On Thu, Jan 07, 2010 at 07:06:11AM -0800, adrian kok wrote:
> Hi 
> 
> I have problem in tar command
> 
> Can you help?
> 
> tar -cv --exclude /var/named/chroot/proc/* -zf backup.tar.gz /var/named 

You must escape the *, so that shell doesn't convert the command to:
 tar -cv --exclude /var/named/chroot/proc/1 /var/named/chroot/proc/2 ...

Use:
tar -cv --exclude /var/named/chroot/proc/\* -zf backup.tar.gz /var/named

Or just --exclude proc?

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20100107/9bf7a02f/attachment-0005.sig>