<<< Date Index >>>     <<< Thread Index >>>

Re: Reliable/safe way of removing empty maildirs?



On Sun, Dec 09, 2007 at 05:59:40PM +0100, Louis-David Mitterrand wrote:
> On Thu, Dec 06, 2007 at 01:03:13PM +0000, Chris G wrote:
> > What's a reliable way of removing empty maildirs?
> 
> my /etc/crontab entry:
> 
> for i in ~/Maildir/.*; do if [ -d "$i" ] && [ ! "$(find "$i" -mindepth 2 
> -type f)" ]; then rm -rf "$i" ; fi ; done

Which is OK until some mail arrives between the find and the rm
surely?!

-- 
Chris Green