Subject: Re: tar fails with largish files
To: Benedikt Meurer <bmeurer@fwdn.de>
From: Mike Cheponis <mac@Wireless.Com>
List: netbsd-users
Date: 11/23/2002 16:37:01
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-251980867-1038098221=:28260
Content-Type: TEXT/PLAIN; charset=US-ASCII

Another way:

On source machine w/the files:

tar cvpf - ./directory | plug remote_machine_name 12345

On destination machine:

plug 12345 | tar xvpf -


The source code for plug.c was written by Todd Whitesel.  The port number
12345, above, is arbitrary; it just needs to be some port not already in use.

-Mike




On Fri, 27 Sep 2002, Benedikt Meurer wrote:

> > [tar fails]
> >
> > Argh.. what is the most reliable way of copying a bunch of files
> > from one machine to another, preserving subdirs, datestamps,
> > protection flags, owners etc.?
>
> What about pax?
>
> HTH, Benedikt

--0-251980867-1038098221=:28260
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="plug.c"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.NEB.4.44.0211231637010.28260@S.Culver.Net>
Content-Description: 
Content-Disposition: attachment; filename="plug.c"

LyoJUGx1Zy5jDQogKglieSBUb2RkIFdoaXRlc2VsDQogKg0KICoJSW50ZXJu
ZXQgc29ja2V0IGNvbm5lY3Rlci9saXN0ZW5lci9yZWNlaXZlcg0KICoJVXNh
Z2U6IFBsdWcgW21hY2hpbmUtbmFtZV0gcG9ydC1udW1iZXINCiAqDQogKglX
aXRoIG1hY2hpbmUgbmFtZSBpdCBjb25uZWN0cywgd2l0aG91dCBpdCBsaXN0
ZW5zIGFuZCByZWNlaXZlcy4NCiAqCU5lZ2F0aXZlIHBvcnQgbnVtYmVycyBk
YnNlcnZkLW1hbmdsZSB0aGVpciBhYnNvbHV0ZSB2YWx1ZS4NCiAqDQogKglz
b2xhcmlzMjogLWxzb2NrZXQgLWxuc2wNCiAqLw0KDQojaW5jbHVkZSA8c3Rk
aW8uaD4NCiNpbmNsdWRlIDxzdG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