gnu tar delete w/exclude
I have a tared ziped archive and I want to --delete
all files --exclude'ing a few that I want to keep
within the archive.
I wanted to use the --delete with gnu tar for
efficiency, I know I can untar the whole thing to disk
and tar back up what I want, but its taking too
much time to go through all of them at night.
I tried using --delete '*' --exclude 'log', but
it almost looks like the --exclude does not apply to
are there a gnu tar arguments that would let
me delete everyting except for a list of critical files.
so for example my file (t.tgz) has these files
I want to keep log and data/*
I tried using gnu tar 1.15.1
cat t.tgz | gunzip |
tar -f - --exclude='call/log' --exclude='data/*' --delete '*' | gzip > 2.tgz
but it deletes everyting, ignoring my exclude