rohrbach@WM:datasink[~]68% tar cf /dev/null src/
rohrbach@WM:datasink[~]69% find src|wc -l
    2552
rohrbach@WM:datasink[~]70% du -sk src
32258   src
rohrbach@WM:datasink[~]71% mkdir src2
rohrbach@WM:datasink[~]72% time find src -exec cp {} src2 \; 
find src -exec cp {} src2 ;  0.31s user 7.55s system 39% cpu 19.858 total).
rohrbach@WM:datasink[~]73% rm -rf src2
rohrbach@WM:datasink[~]74% mkdir src2
rohrbach@WM:datasink[~]75% time find src | cpio -dup src2
61025 blocks
find src  0.02s user 0.03s system 0% cpu 21.739 total
cpio -dup src2  0.26s user 4.84s system 20% cpu 24.862 total

68: warm up the filecache
69: there are 2552 files
70: they are 32.2MB total
71: ready the target dir
72: find -exec approach, all files to one dir
73: clear target area
74: ready it again
75: let find traverse the dir, cpio transfer the files

the cpio approach keeps the hierarchy which might not be what you want
but it looks more efficient, becouse it does not fork off cp for ecery
file.

/k

Brian Dean([EMAIL PROTECTED])@2001.04.21 16:24:36 +0000:
> On Sat, Apr 21, 2001 at 05:34:31PM +0200, Sheldon Hearn wrote:
> 
> > So we have two problems:
> > 
> > 1) Calling cp(1) repetitively is inefficient.
> > 
> > 2) The argument list is too big for cp(1).
> > 
> > Extending cp(1) will not solve (2).  Extending xargs(1) will solve both.
> > So why is an extension to cp(1) being proposed?
> 
> But extending cp does solve the problem.  The proposal was to make
> 
>       % cp -d target src1 src2 ... srcN
> 
> Be equivalent to;
> 
>       % cp src1 src2 ... srcN target
> 
> This makes cp work with xargs;
> 
>       % cat ReallyBigListOfFiles | xargs cp -d target
> 
> -Brian
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-current" in the body of the message

-- 
> Captain Hook died of jock itch.
KR433/KR11-RIPE -- http://www.webmonster.de -- ftp://ftp.webmonster.de
[Key] [KeyID---] [Created-] [Fingerprint-------------------------------------]
GnuPG 0x2964BF46 2001-03-15 42F9 9FFF 50D4 2F38 DBEE  DF22 3340 4F4E 2964 BF46

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to