Pour IMAP MB avec la DATE 19 Oct
Quand il y'a une date comme le 05/12/2022 il faut faire Dec 5 ( avec 3 blanc ) et Dec 25 avec un Blancawk -F':' '{print$1}' /home/dzamaca/etc/maarama.dz/shadow|while read address;do printf "%s@maarama.dz: " "$address";grep "imap.*${address}@maarama.dz" /var/log/maillog*| grep "Oct 19"|awk -F'/' '/bytes/{SUM += $NF}END {print SUM/1024/1024" MB"}';done | grep -v " 0 MB"
Calculer pour une seule boite email
du -sh /home/dzamaca/mail/ebs.dz/y.boutarouk/
Pour IMAP MB
awk -F':' '{print$1}' /home/dzamaca/etc/maarama.dz/shadow|while
read address;do printf "%s@NOM DE DOMAINE.DZ" "$address";
grep "imap.*${address}@NOM DE DOMAINE.DZ
" /var/log/maillog*|awk -F'/' '/bytes/
{SUM += $NF}END {print SUM/1024/1024" MB"}';done | grep -v " 0 MB"
Pour IMAP
awk -F':' '{print$1}' /home/dzamaca/etc/maarama.dz/shadow|while read address;do printf "%s@caarama.dz: " "$address";grep "imap.*${address}@$maarama.dz" /var/log/maillog*|awk -F'/' '/bytes/{SUM += $NF}END {print SUM/1024/1024/1024" GB"}';done
Pour POP3
Introduction
How do I calculate bandwidth usage per email account?
Procedure
Please note that cPanel support cannot assist with troubleshooting, using or otherwise interpreting the output of this command.
The following command can be used to calculate the bandwidth usage per email account for a given domain and user where '$user' represents the cPanel user and '$domain' represents the domain in question:
awk -F':' '{print$1}' /home/$user/etc/$domain.tld/shadow|while read address;do printf "%s@$domain.tld: " "$address";grep "pop3.*${address}@$domain.tld" /var/log/maillog*|awk -F'/' '/bytes/{SUM += $NF}END {print SUM/1024/1024/1024" GB"}';done
Example:
awk -F':' '{print$1}' /home/cptech/etc/cptech.test/shadow|while read address;do printf "%s@$domain.tld: " "$address";grep "pop3.*${address}@$domain.tld" /var/log/maillog*|awk -F'/' '/bytes/{SUM += $NF}END {print SUM/1024/1024/1024" GB"}';done
test@.tld: 1 GB
Commentaires
Enregistrer un commentaire