Zimbra: Get mailbox size with status, created and last login date

Shell script to get mailbox size with status, created and last login date in Zimbra Server

zmaccts | grep “@” | awk ‘{print $1}’ > /tmp/mboxes.list
date > /tmp/mboxsize.txt
#echo “\n” >> /tmp/mboxsize.txt
for mb in `cat /tmp/mboxes.list`;
do
status=`zmaccts | grep $mb | awk ‘{print $1,”,”$2,”,”$3,”,”$5}’`;
msize=`zmmailbox -z -m $mb gms`;
echo “$status,$msize” >> /tmp/mboxsize.txt
done
echo “Completed”

This entry was posted in Zimbra. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *