Tar Exclude?

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


In your second example, the path is attached to the --exclude so it doesn't get
treated like a real path by the shell ... I think this results in your * being
expanded to the contents of the current directory or something like that.

Try putting single quotes around the *.

tar cv --exclude=/var/tmp/directory-to-exclude/'*' -f var.tar /var


Austin