[KLUG Members] remote copy of /homes directory

Adam Tauno Williams awilliam at whitemice.org
Sat Dec 4 10:23:31 EST 2004


> > 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.

> 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.



More information about the Members mailing list