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

Re: Somewhy '--include' doesn't include



On 01/04/16 11:35, Igor Ostapenko wrote:
> Is tar globbing so weird or I'm doing something wrong?

tar globbing is weird.  Also, the way that --include works is weird.

> a test
> a test/dir2
> a test/file1
> a test/file2
> a test/foo1
> a test/foo2
> 
> $ tarsnap -cv --dry-run --include='*foo*' test
> [no files added to archive]

The --include option has to match at every point in the directory
traversal; "test" does not match the pattern "*foo*", so it gets
skipped.  If you change "test" to "test/*", then it will work as
expected.

This is a weird feature which tarsnap inherited from bsdtar and I'm
not sure when it's ever useful...

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid