Page 1 of 1

Domain Email Usage question.

Posted: Fri Oct 22, 2010 6:07 pm
by Galactic Zero
Does anyone have a script or cmd line search that will tell me how much mail is in each email (space used) account in a domain?

Thanks.

Re: Domain Email Usage question.

Posted: Fri Oct 22, 2010 7:53 pm
by faris
du -h /var/qmail/mailnames

Ok, so that's quick and dirty, but it will show you what you need to know

Or how about this (very quick and dirty based on the above)

Code: Select all

path=/var/qmail/mailnames
for domain in $(dir $path); do
echo domain=$domain:
 for mailname in $(dir $path/$domain); do
 if [ -d $path/$domain/$mailname ]
 then
  du -hs $path/$domain/$mailname
 fi
done
done

Re: Domain Email Usage question.

Posted: Sat Oct 23, 2010 5:56 pm
by Galactic Zero
Thanks, script gave me what I needed.

Re: Domain Email Usage question.

Posted: Sun Oct 24, 2010 8:13 am
by breun
'du -sh' works fine generally, but when I'm looking for large files/folders and I don't know where they are exactly I tend to use ncdu (NCurses Disk Usage), which makes browsing a filesystem and finding large files/folders very easy without needing to run du -sh on every folder you want to examine. Check it out if you didn't know this text-based application yet!

Re: Domain Email Usage question.

Posted: Sun Oct 24, 2010 1:48 pm
by faris
A brilliant tip as usual - Thanks breun :-)

Faris.

Re: Domain Email Usage question.

Posted: Mon Dec 20, 2010 10:58 pm
by kellyj994
faris wrote:du -h /var/qmail/mailnames

Ok, so that's quick and dirty, but it will show you what you need to know

Or how about this (very quick and dirty based on the above)

Code: Select all

path=/var/qmail/mailnames
for domain in $(dir $path); do
echo domain=$domain:
 for mailname in $(dir $path/$domain); do
 if [ -d $path/$domain/$mailname ]
 then
  du -hs $path/$domain/$mailname
 fi
done
done

Thanks you for the post.


_________________
Watch movies online free