Neat tape compression trick using a FIFO... was [H-GEN] Linux Backup

Michael Anthon michael at anthon.net
Fri May 9 02:40:13 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

On a related note, here's a little trick I learned this week.  It's pretty
obvious when you think about it but it's probably one of those things
experts would think of and novices[1] wouldn't.

The problem relates to a program that can't pipe it's output to anything but
a file (not stdout).  You want to run this program and write the result to
tape but need to compress it first.  Previously I would have written it to
disk then compressed it and written it to tape (possibly at the same time).
Here's the neat trick way using named pipes (slightly modified from the
original and untested but I think it's right)...

Creating a compressed export file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  mknod /tmp/exp_pipe p                  # Make the pipe
  gzip -c < /tmp/exp_pipe > /dev/rmt/1 & # Background compress and write to
tape
  export file=/tmp/exp_pipe              # Export to the pipe

Cheers,
Michael

 [1] I'm classing myself as a novice, I didn't think of this, I read it in
some doco on Oracle's site.


--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list