On Wednesday, October 9, 2002, at 08:43  PM, Justin R. Miller wrote:

> Hash: SHA1
> Said Matt Simerson on Wed, Oct 09, 2002 at 03:30:55PM -0400:
>> Otherwise, Doug's heading down the right path. Write yourself a script
>> that loops for each domain, and then each user within the domain, and
>> go through and start counting up the bits. You'll likely have issues
>> with depending on the maildirquota file so make sure that if that file
>> doesn't exist, you fall back to a more expensive but accurate method
>> like "du".
> Is there an efficient way to do this if you _don't_ use quotas, ideally
> something other than 'du'?

Efficient is a relative term.  If you're asking if there's a way to do 
this that's nearly as efficient  as using file system quotas, then the 
answer is an easy no.  The reason quotas are so efficient is that the 
kernel is involved, keeping track of disk operations on a per user 
basis. It always has a "real time" idea of how much disk space is in 
use by a customer. There is no other highly efficient way of doing it.

The next best utility (based on my personal experience, the extensive 
reading I've done, and advise of peers) for such a task is du or ls, 
both if which suffer from varying degrees of inefficiency.  I haven't 
ever compared the speed of using du/ls to using perls File::* 
utilities. If using file system quota's isn't an option, experimenting 
with all three could be a fruitful endeavor, the results of which I'd 
find interesting.


Reply via email to