On Wed, Feb 1, 2012 at 1:10 PM, Lamar Owen lowen@pari.edu wrote:
On Wednesday, February 01, 2012 09:18:08 AM Alan McKay wrote:
The basic problem is that I know how much data is there to begin with but I don't know how much room it took up on the tape so I have no idea how much room is left on the tape.
What I would do is use the '-' special filename to pipe the uncompressed tar to stdout, pipe to the compressor of choice, then pipe to tee, and have one branch of the tee go to the tape and the other branch go to a program to count bytes.
Or unless you are talking about many TB per run, decouple the compression from the tape run by sending the output to a disk file that you can sweep to tape later. There are lots of advantages, like not slowing down the tape streaming waiting for compression, being able to do multiple targets at once, and not only knowing the size of what is on the tape so far, but also the total compressed size of what you are going to start to write. Plus, of course, being able to do the tar runs at night when no one is there to swap tapes.