dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
623
share rss forum feed


PToN
Premium
join:2001-10-04
Houston, TX

du certain files in multiple dirs..?

Hello,

i need help getting du to tell me the total size per folder all the dovecot.index* files are taking. I can easily get the total size for each email account, but now i'd like to know the size being used by dovecot index' files.

The problem is that each mailbox can have any number of submailboxes and each mailbox has index files. EX:
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Sent/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Sent.2011/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes.MS/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes.Dell/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes.HP/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes.HP.2009/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes.HP.2010/donvecot.index*
/srv/mail/vmail/+DOMAIN+/+USER+/Maildir/.Quotes.HP.2011/donvecot.index*

So i am not sure how to proceed...

Any ideas?

du + awk?

Thanks.

pablo
MVM
join:2003-06-23
kudos:1
Hi,

Does `Maildir' contain files other than dovecot files? In other words, can you do `du -sh .../Maildir'?

Thx!
-pablo


PToN
Premium
join:2001-10-04
Houston, TX
No, Maildir only contains files related to each email account. It has all the mailboxes, submailboxes, index and message files.

du -sh Maildir/ will give me the total for everything, not the amount of space used by the index files. Remember each mailbox and submailbox has its own set of index files.

pablo
MVM
join:2003-06-23
kudos:1
Hi,

As I'm dense, how about provide an example of what you have and what you'd like to see?

Thx a lot!

-pablo


Pjr
Don't Panic

join:2005-12-11
UK

2 edits
nm
--
Overflow error in /dev/null


PToN
Premium
join:2001-10-04
Houston, TX
reply to PToN
I ended up using:
find ./ -name 'dovecot.index*' -exec du -csh {} \+

And i sort of got what i wanted:
2.0M    ./dovecot.index.cache
28K     ./dovecot.index.log
12K     ./.Junk E-mail/dovecot.index.cache
4.0K    ./.Junk E-mail/dovecot.index.log
4.0K    ./.Junk E-mail/dovecot.index
840K    ./.Sent Items/dovecot.index.cache
32K     ./.Sent Items/dovecot.index.log
264K    ./.Sent Items/dovecot.index
396K    ./dovecot.index
3.5M    total
 

I couldnt figure how to get a total per account, but after i found out who has the biggest mailbox, i figured that just getting that total would be enough for me to calculate the required space used for all index files.

Thanks.