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

Re: Delete 4 million files



On Wed, Mar 18, 2009 at 10:25:13AM -0700, Raquel wrote:
> On Wed, 18 Mar 2009 16:37:53 +0000
> kj <koffiejunkielistlurker@koffiejunkie.za.net> wrote:
> > I discovered a Maildir on my server with 4+ million mails in.  The 
> > result of a cronjob that runs every minute - this has been fixed.
> > 
> > Now, I've been running the usual find . -type f -exec rm {} \;
> > but this is going at about 700,000 per day.  Would simply doing an
> > rm -rf on the Maildir be quicker?  Or is there a better way?
> 
> Why not # cd $Maildir
> then # rm -R *

don't do that; that's asking the shell to expand '*' and then
pass the list (4+ million items!) to 'rm'.  it'll either truncate
the list (and you'll have to run it several times), or it won't
run at all (complaining of 'argument list too long')

--Rob*

-- 
/-------------------------------------------------------------\
| "If we couldn't laugh we would all go insane"               |
|              --Jimmy Buffett,                               |
|                "Changes in Latitudes, Changes in Attitudes" |
\-------------------------------------------------------------/


Reply to: