Tuesday, July 1, 2008

user’s having mail account size more than 20 MB

Today I met with an issue wherein I need to find out the entire user’s having mail account size more than 20 MB on Linux server.

I have created a script for the same.

cd /home

ll /var/cpanel/users | awk '{print $9}' > list

pico test

Copy and paste following code in test file

for user in `cat list`
do
find /home/$user/mail/ -size +20480k
done
echo "~~~~~~~~~~~~~~~~D~O~N~E~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

chmod 755 test

./test

This will generate a list of user name one bye one

No comments: