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.
Domain Email Usage question.
-
- Forum Regular
- Posts: 471
- Joined: Mon Dec 06, 2004 10:43 pm
Re: Domain Email Usage question.
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)
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
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
-
- Forum Regular
- Posts: 471
- Joined: Mon Dec 06, 2004 10:43 pm
Re: Domain Email Usage question.
Thanks, script gave me what I needed.
-
- Long Time Forum Regular
- Posts: 2813
- Joined: Sat Aug 20, 2005 9:30 am
- Location: The Netherlands
Re: Domain Email Usage question.
'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!
Lemonbit Internet Dedicated Server Management
Re: Domain Email Usage question.
A brilliant tip as usual - Thanks breun 
Faris.

Faris.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Re: Domain Email Usage question.
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