[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: excluding /*/ and /**/

On Sat, Apr 28, 2018 at 04:36:00AM -0400, Robert Bowers wrote:
> now, i want to exclude any empty.file in a first level directory (relative to /tmp/zzz).
> # cat /tmp/zzz.excludes
> /tmp/zzz/*/empty.file

* matches with / as well.  So that will exclude any filename beginning with:
and ending in:

> ummm. no. the tmp/zzz/?/???/empty.file (s) should be there?

Unfortunately not.  As noted in http://www.tarsnap.com/selecting-files.html
the behaviour of --include and --exclude comes from BSD tar.  For example,
    "In particular, 'a*b' will match 'foo/a1111/222b/bar"

> i thought to do that it would need an exclude like /tmp/zzz/**/empty.file .
> also, if * matches anything or *nothing at all*, why does tmp/zzz/empty.file
> get grabbed as
> # ls -al /tmp/zzz//empty.file 
> -rw-r----- 1 root root 0 2018-04-28 08:15 /tmp/zzz//empty.file
> would match?

The normal path listing returns
so the exclude doesn't match it.  If the filename was printed as
then it would match.

If you wanted to exclude the top-level empty.file, you could use the exclude

I personally find include & exclude rather confusing.  Would the nodump flag
work in your case?

- Graham