Dominic Mitchell wrote:
>
> Marco Marongiu <[EMAIL PROTECTED]> writes:
> > # You may prefer -mtime instead of -ctime here...
> > find $CACHEDIR -type f -ctime +$MAXAGE -exec rm -f {} \;
>
> This will go much quicker as:
>
> find $CACHEDIR -type f -ctime +$MAXAGE -print0 | xargs -0 rm -f
>
> That will only run one rm process for every few thousand files. Also,
> it uses the "-0" options on both sides for safety.
Ok, but it may fail if the resulting command line is too long (and it
may well be far too long, since cache files have veryverylongfilenames
:-) That's why I prefer to execute rm in find instead of by mean of
xargs.
Cheers!
--bronto
--
Marco Marongiu ([EMAIL PROTECTED]) _ _ ____ __ __
Networks & Computational Systems Service | \| |/ ___)| V |
Network & System Management Area | |\___ \| |
Phone: +39 070 2796 336 |_|\_|(____/|_|V|_|
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]