[KLUG Members] remote copy of /homes directory
bill
bill at billtron.com
Sat Dec 4 10:37:38 EST 2004
On Sat, 2004-12-04 at 10:23, Adam Tauno Williams wrote:
> > > You can:
> > > ssh root@{remotehost} "tar cf - /home | ssh root@{localhost} \"tar -C/
> > > -xf - \" "
> > Wow, that's pretty cool. You can start an ssh connection and have the
> > remote computer run a command all on one line. In your case the tar
> > command outputs to console (-c),
>
> Actually the "c" option means 'create archive', the 'output to standard
> out' is indicated by "f -" as the "f" option indicates the name of the
> archive file is the next parameter and the filename "-" indicates
> standard output (file handle 1). Many UNIX CLI commands use the "-"
> filename.
My mistake. I had been looking at the man docs for gzip and got them
mixed up.
> > Would there be a way to use the SSH tunnel to the third computer simply
> > save the file instead of extracting it?
>
> Your second command could be as simple as "cat > /{somedir}/{somefile}",
> that would write directly to a file.
So the cat would work without a filename, then? The input stream must
contain an end of file character then?
More information about the Members
mailing list