From owner-freebsd-questions Thu Mar 28 13: 6:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from trot.galis.org (ool-18bd0cd9.dyn.optonline.net [24.189.12.217]) by hub.freebsd.org (Postfix) with ESMTP id 3FDFF37B417 for ; Thu, 28 Mar 2002 13:06:17 -0800 (PST) Received: (from gx@localhost) by trot.galis.org (8.11.6/8.11.6) id g2SL7Oh18508; Thu, 28 Mar 2002 16:07:24 -0500 Date: Thu, 28 Mar 2002 16:07:24 -0500 From: George Georgalis To: Giorgos Keramidas Cc: Peter Leftwich , "Scott M. Nolde" , FreeBSD Questions Subject: Re: find | cpio syntax [use scp] Message-ID: <20020328160724.K15459@trot.haven.dom> References: <20020327215404.A39175@smnolde.com> <20020328005735.D97853-100000@earl-grey.cloud9.net> <20020328192151.GA1528@hades.hell.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020328192151.GA1528@hades.hell.gr>; from keramida@ceid.upatras.gr on Thu, Mar 28, 2002 at 09:21:51PM +0200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Mar 28, 2002 at 09:21:51PM +0200, Giorgos Keramidas wrote: >On 2002-03-28 00:58, Peter Leftwich wrote: >> On Wed, 27 Mar 2002, Scott M. Nolde wrote: >> > Greetings, Can anyone provide the syntax for remotely copying files >> > from a remote machine to another using find | cpio | ssh? I'd like to >> > pipe the output over ssh to the local machine and store the file as a >> > gzip or tar.gz file archive. Can anyone lend a hand? >> >> man scp >> (not that I've got it to work yet though, *grunts*!) > >I customarily use ssh to copy files over ssh links: > > $ tar cvf - . | gzip -9c | ssh -T user@host 'mkdir foo ; cd foo ; gzip -cd | tar xf -' > >The trick is to properly quote the ssh command, so that it's not executed >by the local shell :-) I wouldn't mind seeing a translation using cpio, since I understand it can preserve more attributes. I tried but... doesn't work: find /var/tmp -print | cpio -oa | gzip -9c | ssh -T root@fait 'mkdir /tmp/foo ; cd /tmp/foo ; gzip | cpio -i' // George -- GEORGE GEORGALIS, System Admin/Architect cell: 347-451-8229 Security Services, Web, Mail, mailto:george@galis.org File, Print, DB and DNS Servers. http://www.galis.org/george To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message