Re: The directory that I am trying to clean up is huge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Mon, January 25, 2010 10:31, Robert Nichols wrote:
\
>
> Now if the "{}" string appears more than once then the command line
> contains that path more than once, but it is essentially impossible
> to exceed the kernel's MAX_ARG_PAGES this way.
>
> The only issue with using "-exec command {} ;" for a huge number of
> files is one of performance.  If there are 100,000 matched files,
> the command will be invoked 100,000 times.
>
> --
> Bob Nichols         RNichols42@xxxxxxxxxxx
>

Since the OP reported that the command he used:

  find -name "*.access*" -mtime +2 -exec rm {} \;

in fact failed, one may infer that more than performance is at issue.

The OP's problem lies not with the -exec construction but with the
unstated, but nonetheless present, './' of his find invocation.
Therefore he begins a recursive descent into that directory tree.
Since the depth of that tree is not given us, nor its contents, we
may only infer that there must be some number of files therein which
are causing the MAXPAGES limit to be exceeded before the recursion
returns.

I deduce that he could provide the -prune option or the -maxdepth= 0
option to avoid this recursion instead. I have not tried either but
I understand that one, or both, should work.



-- 
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@xxxxxxxxxxxxx
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux