[NTLUG:Discuss] Using SCP (SSH?) in a pipe
Kenneth Loafman
ken at lt.com
Fri Mar 15 12:31:49 CST 2002
MadHat wrote:
>
> 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.
Actually, it does make sense as a backup mechanism, multiple computers
to an offsite backup storage somewhere. Saves having two steps, one to
create the backup, then one to send it offsite.
...Ken
More information about the Discuss
mailing list