[KLUG Members] remote copy of /homes directory

Adam Tauno Williams awilliam at whitemice.org
Sat Dec 4 00:09:19 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), but that output is piped to an ssh
> connection back to your computer (or some third computer).  The third
> computer then UNtars the file, essentially making a duplicate of the
> /home filesystem.
> Would there be a way to use the SSH tunnel to the third computer simply
> save the file instead of extracting it?

Sure, the above is an off the cuff example. In real life the script
command looks like -

ssh root at sardine "tar -C / -cf - var/spool/imap | ssh root at moa \"dd
of=/dev/nst0 bs=1024 conv=sync\" "

- whichs puts the output of the remote tar command back to the local
tape drive.  Either command can be anything.



More information about the Members mailing list