10/25 Suppose I have directories foo, foo/bar, and foo/bar/{a,b,c}. (In
actuality, there are a lot more files.) I'd like tar to archive
everything under foo, except for foo/bar/*, except I do want to keep
foo/bar/a. Unfortunately, tar's exclude patterns seem to take
precedence over any include patterns, so if I exclude foo/bar, I can't
then include foo/bar/a. The easiest workaround I see is to just exclude
foo/bar, and then call tar a second time to append foo/bar/a. Is there
a way to do this with a single call to tar?
\_ Use find to generate a file or dir list, your favorite filtering,
and tar --files-from=<file> to archive the exact list? append
will yield basically the same thing, due to lack of indexing in
tar format. |