balug-piping_tar_to_remote_machine

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



To: Balug-talk@balug.org
From: Roger Chrisman <rogerhc@pacbell.net>
Subject: [Balug-talk] piping tar stndout into scp
Date: Thu, 27 Feb 2003 23:36:45 -0800

[brazil]$ tar -czf optimarkworks.com | scp - \
roger@rogerchrisman.com:/home/roger/

That is not right but can you see what I am trying to do?

What is the right syntax for that?

-- I am trying to tar the dir 'optimarkworks.com' (it is in my pwd on host 
'brazil') and scp the tar directly to my home dir on rogerchrisman.com. As 
you can see I need some coaching. Thanks! --


===

To: Balug-talk@balug.org
From: Nick Moffitt <nick@zork.net>
Subject: Re: [Balug-talk] piping tar stndout into scp
Date: Thu, 27 Feb 2003 23:57:59 -0800

begin  Roger Chrisman  quotation:
> [brazil]$ tar -czf optimarkworks.com | scp - \
> roger@rogerchrisman.com:/home/roger/
> 
> That is not right but can you see what I am trying to do?

	If you don't want it to go to a file, don't use the -f switch.

===

To: Roger Chrisman <rogerhc@pacbell.net>
From: "J. M. Brenner" <doom@kzsu.stanford.edu>
Subject: Re: [Balug-talk] piping tar stndout into scp 
Date: Thu, 27 Feb 2003 23:59:36 -0800


Roger Chrisman <rogerhc@pacbell.net> wrote: 

> tar -czf optimarkworks.com | scp - \
> roger@rogerchrisman.com:/home/roger/
> 
> That is not right but can you see what I am trying to do?
> 
> What is the right syntax for that?
> 
> -- I am trying to tar the dir 'optimarkworks.com' (it is in my pwd on host 
> 'brazil') and scp the tar directly to my home dir on rogerchrisman.com. As 
> you can see I need some coaching. Thanks! --

You haven't told the tar command to send the output to
standard output.  I think this would work: 

  tar -czf - optimarkworks.com | scp - \
  roger@rogerchrisman.com:/home/roger/

Also, I see this in the man page for gnu tar:

       -O, --to-stdout
              extract files to standard output

So I believe this would work also:

   tar -czO optimarkworks.com | scp - \
   roger@rogerchrisman.com:/home/roger/

If you haven't shared ssh keys, the scp is going to bug 
you for a password, so you might want to look into that. 

===

To: Balug-talk@balug.org
From: "Karsten M. Self" <kmself@ix.netcom.com>
Subject: Re: [Balug-talk] piping tar stndout into scp
Date: Fri, 28 Feb 2003 17:13:47 +0000

on Thu, Feb 27, 2003 at 11:36:45PM -0800, Roger Chrisman (rogerhc@pacbell.net) wrote:
> [brazil]$ tar -czf optimarkworks.com | scp - \
> roger@rogerchrisman.com:/home/roger/
> 
> That is not right but can you see what I am trying to do?
> 
> What is the right syntax for that?
> 
> -- I am trying to tar the dir 'optimarkworks.com' (it is in my pwd on host 
> 'brazil') and scp the tar directly to my home dir on rogerchrisman.com. As 
> you can see I need some coaching. Thanks! --

Use ssh.

    tar czf - optimarkworks.com |
        ssh roger@rogerchrisman.com cat \> /home/roger/foo.tar.gz

Peace.

===

To: balug-talk@balug.org
From: "J. M. Brenner" <doom@kzsu.stanford.edu>
Subject: Re: [Balug-talk] piping tar stndout into scp
Date: Thu, 06 Mar 2003 14:13:42 -0800


A related subject to the recent discussion:
"piping tar stndout into scp" 

Lately I've been trying to do things like this: 

  ssh doom@192.168.1.6 'tar c0 /etc /var 2>/dev/null' > /dev/st0 

But I haven't had much success.  With the above command, 
I can extract from tape, but a *few* of the files are
clearly mangled.  (e.g. at the end of a file there might 
be some junk, a lot of nulls, and the contents of another 
file appended where it shouldn't be... then tar spits out 
a message about how it's skipping to the next file header, 
and it proceeds normally for awhile). 

Is there some reason you can't just redirect a tar stream 
to tape?

===

To: <balug-talk@balug.org>
From: "David Dull" <qkstart@ix.netcom.com>
Subject: [Balug-talk] Re:  piping tar stndout into scp
Date: Sat, 8 Mar 2003 10:02:36 -0800

I would use the technique described in man tar(1) for Solaris: 

tar cvfb - 20 . | ssh tapehost dd ibs=20b obs=20b of=/dev/st0 

and 

ssh -n tapehost dd if=/dev/st0 bs=20b | tar xvBfb - 20 

--David Dull
  ddull@ieee.org
  http://www.DavidDull.com

===

To: <balug-talk@balug.org>
From: "David Dull" <qkstart@ix.netcom.com>
Subject: [Balug-talk] Re: piping tar stndout into scp
Date: Sat, 8 Mar 2003 10:07:18 -0800

>
> Lately I've been trying to do things like this:
>
>   ssh doom@192.168.1.6 'tar c0 /etc /var 2>/dev/null' > /dev/st0
> >
> Is there some reason you can't just redirect a tar stream
> to tape?
>

Occasionally there's a short read off the pipe.  What's being recorded is
the data strem from tar mixed with nulls used to pad the short reads.  The
blocksize arguments to tar and dd guarantee a match, so there will be no
null padding.  A blocksize of 20 blocks closely matches the MTU for
ethernet.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu