Hi Paul,
Some have hacked use of tar to allow encryption by calling a wrapper
script for openssl using --use-compress-program option. Example:
/bin/tar -c -v --use-compress-program /usr/local/bin/do_crypt.sh -f
/dev/nst0 /data
This works fine. The problem is when using tape spanning (-M /
--multi-volume).
/bin/tar -c -v --use-compress-program -M --tape-length=1006632960
/usr/local/bin/do_crypt.sh -f /dev/nst0 -f /dev/nst1 /data
Results in error:
/bin/tar: Cannot use multi-volume compressed archives
This makes perfect sense. When using compression, it is unknowable in
advance at what point in tarring the source data "tape-length" will be
reached. In other words, it is not possible to predict what the
compression ratio will be in advance.
Hence this tape spanning scenario creates a problem when attempting to
use an encryption program instead of a compression program.
Proposed solution is to create an option like --use-compress-program
which streams the data through an external program, yet allows use of -M
option.
Does that make sense?
Since my last e-mail, I pulled down the source for tar and started
looking through it. It's not quite as straight forward as I had assumed
since --use-compress-program is essentially an override of -z (gzip), -j
(bzip2), etc. I was hoping to re-use the --use-compress-program code
and just remove the -M check.
--Matt
--
*Matt Olson*
/Director of Platform Services/
*KAVI CORPORATION*
503.813.9383
www.kavi.com <http://www.kavi.com/>
On 01/19/2011 11:54 PM, Paul Eggert wrote:
Thanks for the suggestion. Could you explain that exception in
a bit more detail? Also, what should happen if --use-encrypt-program
and --use-compress-program are both specified?