Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 May 2002 03:23:20 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Odhiambo Washington <wash@wananchi.biz>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Help get reverse of this command
Message-ID:  <20020511002320.GA8672@hades.hell.gr>
In-Reply-To: <20020504103049.GA30802@ns2.wananchi.com>
References:  <20020504103049.GA30802@ns2.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-05-04 13:30, Odhiambo Washington wrote:
> I can do this
> 
> tar $some_args some_dirs | /usr/bin/ssh alligator '(cd /home/wash/Administration/Backups; cat >  filename.tgz)'
> 
> this pipes the output to the remote host...
> 
> 
> How do I 'backpipe' in such a situation, i.e. login to remote host, tar up some_dir and put it here (on
> the host I am logged in)?
> 
> My question is not clear, yes?
> 
> On hostB I have a directory which when tarred up will be 20MB in size. I have only 5MB free
> space on hostB so what I want to do is ssh to hostB tar up that directory but redirect the
> output of tar into hostA where I am logged in. That is what I mean by backpiping ;-)

You can always use something like:

ssh -l username host 'cd /some/path ; tar flags directory' | tar tvf -

The second tar can be replaced with any command that can run locally.
Absurdly long commands are no problem either:

	( cd /tmp ;
	ssh -l keramida freefall 'tar cvf - public_html | gzip -9c -' \
	gzip -9c | tar xvf - )

- Giorgos


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020511002320.GA8672>