From owner-freebsd-questions@FreeBSD.ORG Wed Nov 2 10:45:51 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31E2616A41F for ; Wed, 2 Nov 2005 10:45:51 +0000 (GMT) (envelope-from malcolm.kay@internode.on.net) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A15343D45 for ; Wed, 2 Nov 2005 10:45:50 +0000 (GMT) (envelope-from malcolm.kay@internode.on.net) Received: from alpha.home (ppp211-140.lns1.adl2.internode.on.net [203.122.211.140]) by smtp1.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id jA2Ajf6P043809; Wed, 2 Nov 2005 21:15:41 +1030 (CST) (envelope-from malcolm.kay@internode.on.net) From: Malcolm Kay Organization: at home To: freebsd-questions@freebsd.org Date: Wed, 2 Nov 2005 21:15:40 +1030 User-Agent: KMail/1.8 References: <6.2.3.4.2.20051101232052.035a3040@cobalt.antimatter.net> In-Reply-To: <6.2.3.4.2.20051101232052.035a3040@cobalt.antimatter.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200511022115.40898.malcolm.kay@internode.on.net> Cc: user , Glenn Dawson Subject: Re: tarring over ssh question - pulling from the source to tarfiles X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2005 10:45:51 -0000 On Wed, 2 Nov 2005 05:51 pm, Glenn Dawson wrote: > At 11:20 PM 11/1/2005, user wrote: > >Hello, > > > >Sometimes I have a bunch of data that I want to transfer from > > source to destination over ssh, but I want to tar it up on > > the way over (that is, I don't have enough space on the > > source to create a tarball of the data and then just scp the > > tarball over...) > > > >I do that like this: > > > >tar cf - /files | ssh user@10.0.0.10 "cat > > >/usr/home/user/file_data2.tar" > > > >or if I want to split it into multiple files: > > > >tar cf - /files | ssh user@10.0.0.10 "split - -b 1024m > >/usr/home/user/file_data2.tar" > > > >This works just fine. > > > >----- > > > >My question is, what if I want to initiate this process from > > the destination machine ? In the above example, I am on the > > source machine, and I ssh to the destination, making the tar > > files as it goes. > > > >What if, instead, I am logged into the destination machine, > > and I want to do the same thing - all from the destination > > machine ? > > > >That is, I know that there is a directory /files on the > > source that I want, and I have a login to ssh them to me, > > but I do not want to logon to the source - I want to suck > > /files to me, but also tar them up on the way. > > > >Is that possible ? rsync/rdist are not available. I need to > > do this over ssh and tar, as in the above examples. > > rsync would be a much better choice for your needs. > You must have more information than revealed in the query to know=20 this. "user" does say that he requires a tar file. To "user" =46rom the other end:- % ssh whomever@othermachine tar -f /files | cat > /usr/home/user/file_data= 2.tar Redirection following ssh ( '|' and '>' ) occur at the local=20 end unless within quotes. Thus: % ssh whomever@othermachine tar -f /files "|" cat ">" /usr/home/user/file_= data2.tar or: % ssh whomever@othermachine "tar -f /files | cat > /usr/home/user/file_dat= a2.tar" would attempt to create the tar archive on the remote machine. Malcolm > -Glenn > > >thanks! > > > >_______________________________________________ > >freebsd-questions@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-questions > >To unsubscribe, send any mail to > > "freebsd-questions-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"