[plug] tar vs cp -r

Jim Householder nofixed at westnet.com.au
Thu Mar 10 17:51:03 WST 2005


Craig Ringer wrote:
> On Thu, 2005-03-10 at 14:51 +0800, Jim Householder wrote:
> 
>>Hi
>>
>>On a number of occasions I have seen a preference shown for using tar to 
>>move large trees rather than cp -r.
> 
> 
> In addition to the points made by others, tar works well over ssh (so
> long as you use no-pty, as I found out) and can be *dramatically* faster
> than using `scp -r'.
> 
> It's also possible to pipe a list of files to be copied, generated by,
> eg, `find', into tar (or at least star) or add restrictions like files
> modified after a certain date. `cp -r' isn't really all that smart.
> 
> For just straight copies, cp -aR should do the job nicely. More complex
> tasks can benefit from using an archiver (like tar, star, pax, etc) or
> special tool like rsync or unison.
> 
> --
> Craig Ringer


Thanks guys.  I'm copying distros (2.2, 3.2GB) from dvd to disk for a 
network install.  I've decided to use tar from /media/dvd:
    tar cOv * | tar xC /distros/suse -

It seems to be working, but it's really stuffing the mouse around. 
*very* erratic movement with random click-and-drags, and very slow 
response.  top indicated some idle time but it seems like the system is 
seriously cpu-bound.

Jim



More information about the plug mailing list