-----Original Message-----
From: Bill Gradwohl [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 11:53 AM
To: [EMAIL PROTECTED]
Subject: Re: [vchkpw] reporting on my vpopmail system
Rick Root wrote:
> Hello......... (echo, echo!) is anyone out there?
>
> Rick Root wrote:
>
>> Does anyone have a script or application or something that will view
>> my vpopmail directory structure and give me a report?
>>
>> I would like to know.
>>
>> accounts in each domain
>> # of messages per account
>> amount of disk space per account
>> amount of disk space per domain
>>
>> Thanks.
>>
>> - Rick
>>
>
>
Here's a start to what you might want.
Your criteria is open to interpretation.
I didn't bother prettying it up, and you can add any code you might want.
#!/bin/bash
VIRTUALROOT='/home/vpopmail/domains'
cd ${VIRTUALROOT}
find . -type d -maxdepth 1 | sed 's#^\./##' | while read domain; do
if [ -e ${VIRTUALROOT}/${domain}/vpasswd ]; then
echo
echo Domain - ${domain} - occupies $(du -hs ${domain})
cd ${VIRTUALROOT}/${domain}
find . -type d -maxdepth 1 | sed 's#^\./##' | while read user; do
if [ -d ${VIRTUALROOT}/${domain}/${user}/Maildir ]; then
echo ${user}
echo " Maildir/new contains $(ls -1 ${user}/Maildir/new|wc
-l) messages."
echo " Account occupies $(du -hs ${user})"
fi
done
cd -
fi
done
--
Bill Gradwohl
[EMAIL PROTECTED]
http://www.ycc.com
SPAMstomper Protected email
Thank you for this script also Bill!
=)