On Fri, 18 Nov 2016 14:07:45 +1100
Aaron Mason <simplersolut...@gmail.com> wrote:

> It's a bit long winded, but here's a possibility:
> 
> # cd /
> # tar zcpvf siteXX.tgz /share/* /siteX/*
> <output omitted>
> # tar ztf siteXX.tgz | grep '^/share' | xargs rm -f
> 
> Though I'm not entirely sure what you mean by "on a per site basis" in
> this context, can you elaborate please, especially if the above
> solution is not what you need.
> 
> On Fri, Nov 18, 2016 at 10:20 AM, BSD <b...@cpscoatings.net> wrote:
> > Does misc@ have an alternative method for "gtar --delete"?

Sorry for any vagueness! I don't wish to delete any files from /share,
but have a subset of /share in siteXX.tgz. Also should have mentioned
that /share, /append, and /omit cannot be in the path because
siteXX.tgz is plopped on / during an install. 

What I have so far is to first create an archive using files in /share.

# cd /share
# tar -cpvf /site1/siteXX.tgz *
<output omitted>

Then I append to that archive using files in /site1/append.

# cd /site1/append/
# tar -rpvf /site1/siteXX.tgz *
<output omitted>

Next is where I am stuck. Removing files from the archive that are
FROM /share that are not wanted in /site1/siteXX.tgz. I planned to have
an empty file of the same name in /site1/omit for each file to delete
from the archive.

# cd /site1/omit/
# tar --delete /site1/siteXX.tgz *
      ^^^^^^^^
      invalid flag

Or perhaps I need to have a list of the files that gets appended and
redacted before ever creating the archive. 

Hope this picture got clearer...

Reply via email to