[Sussex] Copying directories across machines [Was: Mail for Nik]

Karl E. Jorgensen karl at jorgensen.com
Tue Apr 12 16:05:36 UTC 2005


On Tue, Apr 12, 2005 at 01:55:18PM +0100, steve at dobson.org wrote:
> Hi Goat liker
> 
> On Tue, Apr 12, 2005 at 12:36:24PM +0000, sussex at welikegoats.com wrote:
> > On Tue, 12 Apr 2005 steve at dobson.org wrote:
> > > On Tue, Apr 12, 2005 at 01:25:52PM +0100, Richie Jarvis wrote:
> > > ...
> > >   (cd <src-dir> && tar cf - .) | (cd <dst-dir> && tar xcf -)
> >  ...
> > Also, I don't really see the difference between this and cp -a
> > src-dir dst-dir ...
> 
> ...
> 
> But the real power is in adding to the pipeline.  Take a look at the
> example I am using here which copies from one machine to another.
> Compression might have been useful here (the network is the bottleneck).
> 
>    $ tar cf - . | ssh root at 10.100.1.198 "cd /usr/src/linux-2.6 && tar xvf -"
> 
> That is something you can't do with cp(1).

But you can do with scp ...

    $ scp -pr ./ root at 10.100.1.198:/usr/src/linux-2.6/

-- 
Karl E. Jørgensen
karl at jorgensen.com   http://karl.jorgensen.com
Your eyes are weary from staring at the screen...  You feel sleepy...  Notice
how restful it is to watch the cursor blink...  Close your eyes (but keep
reading)...  The opinions stated above are yours. You cannot imagine why you
ever felt otherwise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20050412/5f42ac0b/attachment.pgp 


More information about the Sussex mailing list