ZimbraMailQuota: Difference between revisions
Appearance
No edit summary |
|||
| Line 1: | Line 1: | ||
[[category:Heromotocorp Biz]] | |||
[[category:Tetra Clients]] | |||
== Zimbra Mail Quota in MB == | == Zimbra Mail Quota in MB == | ||
| Line 4: | Line 6: | ||
Create a new file having extension .sh and use the code below mentioned :- | Create a new file having extension .sh and use the code below mentioned :- | ||
#!/bin/bash | #!/bin/bash | ||
output="/root/accountusage" | |||
output="/root/accountusage" | domain="heromotocorp.biz" | ||
touch $output | |||
domain="heromotocorp.biz" | server=`hostname` | ||
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line | |||
touch $output | do | ||
usage=`echo $line|cut -f2 -d " "` | |||
server=`hostname` | quota=`echo $line|cut -f3 -d " "` | ||
user=`echo $line|cut -f1 -d " "` | |||
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line | status=`/opt/zimbra/bin/zmprov ga $user | grep ^zimbraAccountStatus | cut -f2 -d " "` | ||
echo "$user `expr $usage / 1024 / 1024`Mb `expr $quota / 1024 / 1024`Mb ($status account)" >> $output | |||
do | done | ||
usage=`echo $line|cut -f2 -d " "` | |||
quota=`echo $line|cut -f3 -d " "` | |||
user=`echo $line|cut -f1 -d " "` | |||
status=`/opt/zimbra/bin/zmprov ga $user | grep ^zimbraAccountStatus | cut -f2 -d " "` | |||
echo "$user `expr $usage / 1024 / 1024`Mb `expr $quota / 1024 / 1024`Mb ($status account)" >> $output | |||
done | |||
======================================================================================================================================================== | ======================================================================================================================================================== | ||
Save the file and then execute the cammand :- | Save the file and then execute the cammand :- | ||
#sh -x name.sh | #sh -x name.sh | ||
======================================================================================================================================================== | ======================================================================================================================================================== | ||
Revision as of 05:01, 27 June 2014
Zimbra Mail Quota in MB
Create a new file having extension .sh and use the code below mentioned :-
#!/bin/bash
output="/root/accountusage"
domain="heromotocorp.biz"
touch $output
server=`hostname`
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line
do
usage=`echo $line|cut -f2 -d " "`
quota=`echo $line|cut -f3 -d " "`
user=`echo $line|cut -f1 -d " "`
status=`/opt/zimbra/bin/zmprov ga $user | grep ^zimbraAccountStatus | cut -f2 -d " "`
echo "$user `expr $usage / 1024 / 1024`Mb `expr $quota / 1024 / 1024`Mb ($status account)" >> $output
done
============================================================================================================================================
Save the file and then execute the cammand :-
#sh -x name.sh