Subject: Re: Dump questions
To: None <netbsd-help@NetBSD.ORG>
From: Brian C. Grayson <bgrayson@marvin.ece.utexas.edu>
List: netbsd-help
Date: 07/15/1998 22:06:03
On Thu, Jul 16, 1998 at 10:06:02AM +1000, Simon Burge wrote:
> 
> How about using ufsdump to dump to stdout, and then ssh'ing?  Something
> like:
> 
> 	ufsdump 0f - /fs | ssh backupbox dd of=tape bs=someblocksize

  I had already thought something similar (dump ... | ssh
backupbox rmt), but unfortunately it won't do the trick when
multi-tape dumps are performed, right?  In that case, simply pipeing 
doesn't allow rmt's result codes to go back to dump.

  However, this and a note by John Hoogerdijk reminded me of a
program suite by Robert Forsman called netpipes, that allows one to
create a socket that will run a specified program, and direct
stdin/stdout properly.  Basically, one sets up a daemon on a port
number via one program (faucet), and then connects to it with
the other program (hose).  Here's a short example that I think
might do the trick (I'll play around with it in the next few days):
The single-quotes are simply to separate the invoked command from
other args, and are not needed in real life.

##  Start up an rmt on port 5555, and only accept one connection
##  before stopping listening.  The port number could be chosen
##  dynamically to avoid evil people.  faucet automatically
##  backgrounds itself.
ssh backuphost 'faucet 5555 -once -in -out rmt'

##  Now start up a local client that connects to that port, and
##  uses stdin and stdout from the socket.
hose backuphost 5555 -in -out 'ufsdump 0f - /fs'

The datastream itself won't be encrypted, but even that could be
done via a local loopback faucet/hose that encrypts before going
over the wire, and a suitable decrypt loopback on the backuphost
end.

  Thanks for the ideas, and for jogging my memory.  It's been 3
years since I've touched netpipes!  It's also added its own
security features in the last 3 years.  Netpipes is available at:
http://www.purplefrog.com/~thoth/netpipes/

  Brian
-- 
"Old programmers never die.  They just branch to a new address."
						-Anonymous