Jump to content

ZimbraMailQuota: Difference between revisions

From TetraWiki
Vijay (talk | contribs)
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
[[category:Tetra Clients]]
[[category:Tetra Clients]]


[[Category: HERO MOTO CORP]]


[[Category: Zimbra Mail Quota]]
 
== Objective ==
 
Find out and create csv file with user mail quota ( used and allocated )on '''Zimbra Server''' i.e HEROMOOCORP.BIZ


== ''''''Zimbra Mail Quota in MB''''''==
== ''''''Zimbra Mail Quota in MB''''''==
Line 24: Line 26:
  done
  done


:wq!


========================================================================================================================================================
 
=='''How to run this script'''==
 
=='''How to run this script'''==


Create a file first /root/accountusage and then perform the given steps :-
Create a file first /root/accountusage and then perform the given steps :-
Line 34: Line 36:


  #sh -x name.sh
  #sh -x name.sh
========================================================================================================================================================

Latest revision as of 11:00, 10 July 2014



Objective[edit]

Find out and create csv file with user mail quota ( used and allocated )on Zimbra Server i.e HEROMOOCORP.BIZ

'Zimbra Mail Quota in MB'[edit]

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



How to run this script[edit]

Create a file first /root/accountusage and then perform the given steps :-

Save the file and then execute the cammand :-

#sh -x name.sh