The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

eximstats mysql DB growing big..

Discussion in 'General Discussion' started by denisdekat09, Apr 11, 2004.

  1. denisdekat09

    denisdekat09 Well-Known Member

    Joined:
    Mar 2, 2002
    Messages:
    265
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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 :)
     
  2. Planet_Master

    Planet_Master Well-Known Member

    Joined:
    Apr 18, 2002
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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.
     
  3. denisdekat09

    denisdekat09 Well-Known Member

    Joined:
    Mar 2, 2002
    Messages:
    265
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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!
     
  4. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I am looking for a similar fix to domlogs where it just crops old entries and rewrites new ones. Any idea where tostart looking?
     
  5. denisdekat09

    denisdekat09 Well-Known Member

    Joined:
    Mar 2, 2002
    Messages:
    265
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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 :)
     
Loading...

Share This Page