From owner-freebsd-questions Thu Mar 28 1: 5:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from dns.perimeter.co.za (dns.perimeter.co.za [196.25.164.254]) by hub.freebsd.org (Postfix) with ESMTP id 2425637B417 for ; Thu, 28 Mar 2002 01:05:04 -0800 (PST) Received: from PATRICK (loopback.mipjhb [209.212.102.245] (may be forged)) by dns.perimeter.co.za (8.11.1/8.11.1) with SMTP id g2S94H530568; Thu, 28 Mar 2002 11:04:19 +0200 (SAST) (envelope-from bsd@perimeter.co.za) Message-ID: <00ed01c1d637$4c5ccca0$b50d030a@PATRICK> From: "Patrick O'Reilly" To: "Scott M. Nolde" Cc: References: <20020327215404.A39175@smnolde.com> Subject: Re: find | cpio syntax Date: Thu, 28 Mar 2002 11:02:28 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 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 From: "Scott M. Nolde" > 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? > If you want to keep it as a .tgz, then why not use tar in the first place (instead of find | cpio) ? I did this and it worked fine: # cd /local/path/to/be/tarred # tar czf /tmp/1.tgz . # scp /tmp/1.tgz myuserid@hostname.com:/full/path/to/remote/tarball.tgz I did try: # tar czf - . ; scp - myuserid@hostname.com:/full/path/to/remote/tarball.tgz but that did horrible things to my terminal, so don't do it :) To create the archive on a remote box, then fetch it back, try this: # ssh myuserid@hostname.com "tar czf /tmp/1.tgz /remote/path/to/be/tarred" # scp myuserid@hostname.com:/tmp/1.tgz /full/path/to/local/tarball.tgz You can also do scp between two remote hosts, I believe, but I have never tried it. Regards, Patrick O'Reilly. ___ _ __ / _ )__ __ (_)_ __ ___ _/ /____ __ / __/ -_) _) / ~ ) -_), ,-/ -_) _) /_/ \__/_//_/_/~/_/\__/ \__/\__/_/ http://www.perimeter.co.za To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message