GNU tar: How to mix include and exclude on when --listed-incremental is in effect?
1
vote
0
answers
203
views
I have a
tar
command where I need to mix "include" and "exclude" operations. This is - when not using --listed-incremental
working perfectly, but not when combined with --listed-incremental
:
## What I have tried:
* Setup test scenario
/tmp/tartest$ rm * ; touch a b
* --exclude a
*before* the include (the simple a
) works as expected (a
is excluded):
/tmp/tartest$ gtar cvf test.tar --exclude a a b
b
* Include (the simple a
) *before* the --exclude a
works as expected (a
is included):
/tmp/tartest$ gtar cvf test.tar a --exclude a a b
a
b
* --exclude a
*before* the include (the simple a
) works as expected (a
is excluded), even with --listed-incremental
is in operation:
/tmp/tartest$ rm snapshot ; gtar cvf test.tar --listed-incremental=snapshot --exclude a a b
b
* Include (the simple a
) *before* the --exclude a
does *not* work as expected (a
is *not* included) with --listed-incremental
is in operation:
/tmp/tartest$ rm snapshot ; gtar cvf test.tar --listed-incremental=snapshot a --exclude a a b
b
### Where is a???
* For level-1 incremental backups, the same holds (but plays no role for this question).
* My version is 1.34:
/tmp/tartest$ gtar --version
tar (GNU tar) 1.34
I'm skipping mentioning more tests I have done (obviously my real command line is more complex).
## Question
GNU tar 1.34 is from March 2021. I cannot imagine that this very basic functionality is a long-term-bug in tar
. I have browsed the bug-tar
mailing list and found no relevant mention of "incremental", "include" or "exclude" whatsoever. What am I doing wrong; how do I have to fix my command line so a
is included in the archive when it is present befor its respective --exclude
on the command line?
Asked by AnoE
(947 rep)
Sep 29, 2022, 10:53 AM
Last activity: Sep 29, 2022, 10:58 AM
Last activity: Sep 29, 2022, 10:58 AM