I am surprised with how fast my hard drive is filling up with email for my clients. Is there a way for me to check on which accounts are my “saving everything under the sun in their inbox” culprits?
Keith.
I am surprised with how fast my hard drive is filling up with email for my clients. Is there a way for me to check on which accounts are my “saving everything under the sun in their inbox” culprits?
Keith.
You could try just looking on the filesystem to see which domain/user is using the most space.
Become root (if you’re not already) with “sudo su -
”.
Next, cd into the top of the mailbox dir tree, “cd /home/user-data/mail/mailboxes
”
And run this command from that directory, “du -sh */*
”
That will give you a listing of size and domain/email-address.
thank you.
the DU command works really nicely for each domain but not so much per subdirectory. Would have been handy to be able to tell the user, “hey there, you have a huge Sent folder; any chance you do some archiving?”.
Glad that the culprit domain only has two users and one of them doesn’t really use it.
Thanks again,
Keith.
To be able to get the size of sub-directories I would run the following command:
du -h */* | grep -E '[0-9]{2,}M|[0-9]{1,}G' | sort -u -t$'\t' -k1,1 | sort -t$'\t' -k2
Command breakdown:
du -h */*
grep -E '[0-9]{2,}M|[0-9]{1,}G'
sort -u -t$'\t' -k1,1
sort -t$'\t' -k2
use for subfolders:
ncdu