1

The following simple command yield the following result:

$ tar -zcvf clusterops.tgz ansible --exclude='.git' --exclude='.idea' --exclude='**/.ssh' --exclude='*.log' | grep ssh
ansible/.ssh/
ansible/.ssh/ClouderaManagerKey.ppk
ansible/.ssh/ClouderaManagerKey.pem

What is going on here? Why the pattern '**/.ssh' fail to do anything?

tribbloid
  • 153
  • 5
    At least for GNU tar, AFAIK it only supports "a glob(3)-style wildcard pattern" whereas you appear to be trying to use a "globstar" pattern similar to that provided by some shells - see for example Recursive glob? – steeldriver Mar 24 '18 at 21:36
  • In effect, you are telling the command to exclude a file called .ssh located in any directory within the archive. Instead, use --exclude='*/.ssh/*' – Nasir Riley Mar 25 '18 at 02:02

0 Answers0