yup to all of the above - the null-terminated version is preferable.

Except.

xargs won't play with busybox's tar.

busybox tar can't append - so you can't create an empty archive and
append to it with tar - coz it ain't got no append capability.

And you can't use tar --create, because if xargs DOES do it's job and
split the list, only the last section will end up in the archive.

So the only way to do this is

1. compile a big tar
or
2 create a list of files and feed the list to tar.

D

In article <[email protected]>, [email protected]
(Bob Dunlop) wrote:

> *From:* Bob Dunlop <[email protected]>
> *To:* [email protected]
> *Date:* Wed, 2 Feb 2011 17:10:54 +0000
> 
> Hi,
> 
> On Wed, Feb 02 at 03:42, Joakim Tjernlund wrote:
> ...
> > > > e.g. What does "rm -f /tmp/*" do if there are 12,000,000
> > > > files in the /tmp directory?  (Hint: nothing good!)
> > > > Whereas "find /tmp -mindepth 1 -maxdepth 1 ! -type d -print0 \
> > > >               | xargs -r0 rm -f" will succeed.  More
> > > > complicated, to be sure, but more robust.
> > 
> > In this case I guess
> >  find /tmp -mindepth 1 -maxdepth 1 ! -type d -exec rm -f {} \;
> > 
> > would work just as well and is less complicated or am I missing 
> > something?
> 
> I'm not 100% sure your find will cope with a filename with spaces 
> in it.
> Might be a portability issue if nothing else.
> 
> The big difference is the xargs version will group files together 
> making
> far fewer calls to rm whereas your version invokes a new rm for 
> each file.
> That could be a big efficiency hit if there are truely large 
> numbers of
> files involved.
> 
> -- 
>         Bob Dunlop
> _______________________________________________
> busybox mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/busybox
> 
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to