1833016 Members
2439 Online
110048 Solutions
New Discussion

Re: script for mail IDs

 
wish_1
Frequent Advisor

script for mail IDs

dear all,

We have around 1500 mail user with more 100 MB size. Right now we want around 1000 users which have 50 MB to reduce to 25 MB. what would be the script which can do for all the 1000 users

thanks in adv.
regards
wish
7 REPLIES 7
Peter Godron
Honored Contributor

Re: script for mail IDs

Wish,
could you please clarify:
1. What is 100Mb size?
2. What do you want to reduce from 50 to 25 for these 100 users?

Are you talking about individuals mail boxes in /var/mail?
James R. Ferguson
Acclaimed Contributor

Re: script for mail IDs

Hi:

# find /var/mail -xdev -type f -size +25000000c

This will find (and list) all mail boxes whose size exceeds 25MB (well, properly, we should use 25*1024*1024).

See the manpages for 'find' for a detailed explanation.

Regards!

...JRF...
wish_1
Frequent Advisor

Re: script for mail IDs

dear all,

the mailbox size is 100MB, i want to reduce these to 25 MB, i want to know how to run the script and what would be the script

i have already found these (find /var/mail -xdev -type f -size +25000000c)

thanks you for reply
regards
Peter Godron
Honored Contributor

Re: script for mail IDs

wish,
I don't think there is a clean solution.
You could just split each users mail file into 25Mb sizes (split -b) and remove all but the last split file. But this may mean the user can not use the mail file, as it would be in wrong format.
If you for example lose the From line the mail is not shown.

Best way may be to ask the users to read their mail!
Peter Godron
Honored Contributor

Re: script for mail IDs

Wish,
sorry to follow-up mail, but I became interested in this problem.

Doing a search did bring up a possible solution, not based on filesize but date !
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=958047

No doubt somebody is going to come up with a context sensitive cut perl program.
Peter Godron
Honored Contributor

Re: script for mail IDs

Wish,
any update on this? Have you tried out any of the solutions?
wish_1
Frequent Advisor

Re: script for mail IDs

Dear Peter Godron

We have to do it mannual only

Thanks and Regards
Wish