eximstats mysql DB growing big..

denisdekat09

Well-Known Member
Mar 2, 2002
266
0
316
San Francisco
Hello,

I read some good threads on recreating the eximstats DB using the /usr/local/cpanel/etc/eximstats.sql and eximstats.sql.in..

I wanted to see if anyone here may have an opinion as to how to have the stats flushed or something, as if they keep growing, it will be unmanageable,. Is there an option to have stats gone after two months or so?

I hate to delete it and recreate it by hand, as it is about 500 megs large right now, the design of the use of the DB is such that it seems like it needs a pruning once in a while. Some of the more recent info could be usefull.

Thank you all in advance :)
 

Planet_Master

Well-Known Member
Apr 18, 2002
232
0
316
New Yorker
Exim stats as well as other stats can grow on a crowded and even not so crowded server. I run stats cleanups once a month for Exim, who needs old mail stats anyways?

Good to clean our domlogs as well as stats in log file every couple months, great space reclaimer.
 

denisdekat09

Well-Known Member
Mar 2, 2002
266
0
316
San Francisco
Hi PlanetMaster :)

Thanks for your answer. Yes, I know quite well about my log files that grow big, in /var/log and in /var/httpd/domlogs and so on...

Thing is, eximstats can sometimes be usefull for catching someone who may hvae been abusing their mailing rights, so deleting the mysql DB is not my favorite option, what I would love is to crop old data in the DB....

It looks like I may need to hit www.mysql.com and look for a command that deletes older entires :) I like to keep as much of current log type data as possible, you never know ;)

thanks for your ideas in any case :) I appreciatte your effort to help!
 

denisdekat09

Well-Known Member
Mar 2, 2002
266
0
316
San Francisco
You should be able to do some sort of bash script. Say using some commands like 1) cat file | wc -l, then 2) calculate the percentage of logs you want to keep and ho many lines that it would be, and 2) run tail -that_number file > newlogs, then 4) move new logs over old logs, thereby deleting old logs...

I bet you could do something similar with much more refinement ;)

I want to crop old entires into the exim_stats mysql which is is different than croping a text file. So I got to read up my MySQL ;) I will tackle it the weekend :)