From a87d30c7a7ad43df48f5da8256426c0a4f98e506 Mon Sep 17 00:00:00 2001 From: Axel ROGER Date: Thu, 24 Jan 2013 10:27:42 +0000 Subject: [PATCH] --- src/update_quota_mail.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/update_quota_mail.sh b/src/update_quota_mail.sh index 669b9875..b77ccc94 100755 --- a/src/update_quota_mail.sh +++ b/src/update_quota_mail.sh @@ -30,13 +30,19 @@ for i in $d ; do if [ -d "$i" ];then user=`ls -l $i| tail -n 1|cut -d' ' -f 3` - size=0 # We grep only mails, not the others files mails=`find $i -type f | egrep "(^$i)*[0-9]+\.M"` - for j in $mails - do - size=$(( $size + `du -b $j|awk '{print $1}'`)) - done + + # This part only count mails size + #size=0 + #for j in $mails + #do + # size=$(( $size + `du -b $j|awk '{print $1}'`)) + #done + + # This part count the total mailbox size (mails + sieve scripts + ...) + size=`du -b -s $i|awk '{print $1}'` + mail_count=`echo $mails|wc -w` echo "folder : "$i echo "mail count : "$mail_count