[lug] dd ssh pipe to bzip?

George Sexton georges at mhsoftware.com
Wed Nov 17 16:10:32 MST 2010



George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com


> -----Original Message-----
> From: lug-bounces at lug.boulder.co.us [mailto:lug-
> bounces at lug.boulder.co.us] On Behalf Of Orion Poplawski
> Sent: Wednesday, November 17, 2010 2:08 PM
> To: Boulder (Colorado) Linux Users Group -- General Mailing List
> Subject: Re: [lug] dd ssh pipe to bzip?
> 
> On 11/17/2010 02:04 PM, Paul Nowosielski wrote:
> > Hi!
> >
> > Can someone give me a little advice
> > on how to do this.
> >
> > I'm running dd via ssh pipe and then I would like to
> > compress the output. I'm not sure how to do it so the
> > receiving server compresses it.
> >
> > # this is what I have so far
> > dd if=/dev/mapper/VolGroup00-LogVol00 | ssh offsite at dev -i
> > /root/.ssh/id_dsa_offsite "dd of=gw2.iso"
> >
> >
> > # I tried this and a few variations but it didn't work
> >   dd if=/dev/mapper/VolGroup00-LogVol00 | ssh offsite at dev -i
> > /root/.ssh/id_dsa_offsite "dd of=gw2.iso | cat |bzip2 "
> 
> dd of=file means output to the named file, so there is nothing left to
> compress.
> 
> How about:
> 
> dd if=/dev/mapper/VolGroup00-LogVol00 | ssh offsite at dev -i
>   /root/.ssh/id_dsa_offsite "bzip2 -c > gw2.iso.bz2"

You should use "-Te none" to disable Pseudo TTY allocation, and to disable
escape sequences.

 dd if=/dev/mapper/VolGroup00-LogVol00 | ssh -Te none offsite at dev -i
   /root/.ssh/id_dsa_offsite "bzip2 -c > gw2.iso.bz2"

If a data file happened to contain the magic escape sequence your SSH
session would get dumped to a > prompt.

> 
> 
> 
> --
> Orion Poplawski
> Technical Manager                     303-415-9701 x222
> NWRA/CoRA Division                    FAX: 303-415-9702
> 3380 Mitchell Lane                  orion at cora.nwra.com
> Boulder, CO 80301              http://www.cora.nwra.com




More information about the LUG mailing list