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

MadHat madhat at unspecific.com
Fri Mar 15 12:25:13 CST 2002


On Fri, 2002-03-15 at 12:05, Kenneth Loafman wrote:
> 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.

running tar, you have to say
tar cvf "TARFILE" filelist, if you want to pipe it, you have to do
tar cvs - filelist | whatever
if you care you to do what you want, it will be ssh not scp, so
something like
tar cvf - filelist | ssh user at host 'gzip - > file.tgz'
because what ever you do, you have to redirect the output on the other
side.  you are sending the output of the tar across the wire on STDOUT.

as if that makes sense.

> 
> ...Ken
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
> 
-- 
MadHat at Unspecific.com
gpg --keyserver wwwkeys.us.pgp.net --recv-keys 9DDC3E98
Key fingerprint = E786 7B30 7534 DCC2 94D5  91DE E922 0B21 9DDC 3E98





More information about the Discuss mailing list