Hey folks, I looked at the man page and don't see any way to do this - maybe it is a function of the compression program used I dunno. Is there any way to get gtar to report on the compression it achieved? I can't just check file sizes because I'm writing data to tape. 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. thanks, -Alan -- ?Don't eat anything you've ever seen advertised on TV? - Michael Pollan, author of "In Defense of Food"
On Wed, Feb 1, 2012 at 8:18 AM, Alan McKay <alan.mckay at gmail.com> wrote:> Hey folks, > > I looked at the man page and don't see any way to do this - maybe it is a > function of the compression program used I dunno. > > Is there any way to get gtar to report on the compression it achieved? > > I can't just check file sizes because I'm writing data to tape. > > 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.There is a --totals option, but that is before compression. I don't think there is a way to do it. You can use -f /dev/null and --totals to get a quick estimate of the uncompressed size of what matches the tar arguments (for full/incremental). Gnu tar 'special cases' output to /dev/null and doesn't bother actually reading the data but it adds up the sizes from the directory. That was added so amanda can do estimates that let it decide how to mix the fulls and incrementals each day to fill a tape. -- Les Mikesell lesmikesell at gmail.com
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.
On Wednesday, February 01, 2012 04:00:06 PM Alan McKay wrote:> The GZIP environment variable is working really well. It tells me the > compression ratio and even send it to STDERR for me so I can easily > separate that from the gtar output.Cool. That's useful information.
On 02/01/2012 04:18 PM, Alan McKay wrote:> Hey folks, > > I looked at the man page and don't see any way to do this - maybe it is a > function of the compression program used I dunno. > > Is there any way to get gtar to report on the compression it achieved? > > I can't just check file sizes because I'm writing data to tape. > > 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.You could ask tar to automatically request tape change when reaching end of tape: -M, --multi-volume create/list/extract multi-volume archive Lec