bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] Monthly backup doesn't expand files, but which are in the


From: Ralph Corderoy
Subject: Re: [Bug-tar] Monthly backup doesn't expand files, but which are in the archive
Date: Sat, 27 Aug 2016 16:46:24 +0100

Hi Steffen,

> > >     $tarxcmd = "tar -c -f - | $COMPRESSOR > $ar";
...
> > >     unless (open XARGS, "| xargs -0 $tarxcmd 2>>$MFFN") {
> >
> > So xargs may run tar more than once, and if $#{$listref} has been
> > growing then perhaps it's tipped over from one invocation to two
> > recently?
>
> I don't understand this sentence of yours?

You're having perl open a pipe to

    xargs -0 tar -c -f - | xz >monthly-backup.tar.xz

xargs runs the given command more than once under certain circumstances.
That's its raison d'ĂȘtre.  If that happened in your case then you've
effectively run something like

    (tar -c -f - foo; tar -c -f - bar) | xz >monthly-backup.tar.xz

> > Is monthly-backup.tar the value of $ar above?  Or have you manually
> > decompressed it?
>
> I ran xz -d on it first, manually.

A-ha!

> >     $ (tar cf - foo; tar cf - bar) | (tar tf -; tar tf -)
> >     foo
> >     bar

If tar did run twice to create the file then you need to run it twice
when reading the file, with the second picking up where the first stops.

    p=mail/2013.track
    (tar tf -; echo still want $p; tar tf -) <monthly-backup.tar |
    fgrep $p

Cheers, Ralph.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]