[NTLUG:Discuss] Using SCP (SSH?) in a pipe

Cameron Moore lists at unbeatenpath.net
Sat Mar 16 13:22:00 CST 2002


* ken at lt.com (Kenneth Loafman) [2002.03.16 12:07]:
> I think I saw it here...
> 
> What I want to do is:
> 
>     tar cvz filelist | scp user at backup:foo
> 
> but there's some magic I'm missing.  Any clues?  I've gone blank.
> 
> ...Ken

Not exactly what you're asking for, but if you just want to replicate a
directory structure onto another machine, this is a good method of doing
so:

  $ tar -zcvp --same-owner DIR/ | ssh -C root at remote -x \
   "tar -zxvp --same-owner -C DIR/"

I used this method while replacing a server to copy home dirs.  Works
really well.
-- 
Cameron Moore
[ Boycott shampoo! Demand the REAL poo! ]




More information about the Discuss mailing list