Date: Thu, 28 Mar 2002 11:02:28 +0200 From: "Patrick O'Reilly" <bsd@perimeter.co.za> To: "Scott M. Nolde" <scott@smnolde.com> Cc: <freebsd-questions@FreeBSD.ORG> Subject: Re: find | cpio syntax Message-ID: <00ed01c1d637$4c5ccca0$b50d030a@PATRICK> References: <20020327215404.A39175@smnolde.com>
next in thread | previous in thread | raw e-mail | index | archive | help
From: "Scott M. Nolde" <scott@smnolde.com> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00ed01c1d637$4c5ccca0$b50d030a>