BuycPanel Blog

BuycPanel Blog

Latest news and updates

3/04/2015 – Delete the Mail Statistics Logs

Posted by Jamison on 04 03 2015.

Mail statistics logs from your updates and daemons can clog up your email with information. While you still need this kind of data, you can consolidate your data into one database after you’ve looked through them at the right time. Here is a solution to your crowded email and the endless line of mail logs that may be taking up too much space:


The MySQL database in the /var/lib/mysql/eximstats file stores mail statistics.


Remove the entries from this database. Alternatively, you must clear the mail logs in the /var/log, exim_mainlog, exim_rejectlog, and exim_paniclog files daily. A cronjob can easily execute a script that clears these files.


If that doesn’t work for you, here is another solution that you can try:


If the size of your eximstats database is getting large ( you can check the DB space usage using du )


  • du -s -h /var/lib/mysql/eximstats


Then you can clean the database entries. You may also wish to blank the current exim log files at /var/log/exim*


If you want to clean the eximstats MySQL database, from an SSH prompt type…


  • mysql eximstats


Then from with the MySQL application type…


  • delete from sends;
  • delete from smtp;


If you want to remove the existing log entries, from an SSH prompt type…


  • cd /var/log
  • rm -fr exim*.1
  • rm -fr exim*.2
  • rm -fr exim*.3
  • rm -fr exim*.4
  • rm -fr exim_mainlog ; touch exim_mainlog ; chown mailnull.mail exim_mainlog
  • rm -fr exim_paniclog ; touch exim_paniclog ; chown mailnull.mail exim_paniclog
  • rm -fr exim_rejectlog ; touch exim_rejectlog ; chown mailnull.mail exim_rejectlog


Then restart the exim service


  • service exim restart


For an easier solution that you can try, here is something you can do through your cPanel interface:


When managing a new website, your webserver may save old stats that you don’t want to show in your AWStats statistics. These stats can be cleared out by removing them from your tmp/awstats folder. This is going to remove your stats for all your domains. You can delete specific stats for specific domains and dates as well, depending on what stats you want to remove.


The stats are stored in text files in regards to the subdomains. To delete a specific domain stats, you can find the text file for the subdomain and remove it only. A typical subdomain file name will look like the following:


This txt file shows the date 01-20-2012 for the subdomain Deleting this file will deletw the stats for that specific date and that specific subdomain. Below are the steps on how to do this.


Here are the steps:


  1. Login into your cPanel.
  2. Go to the File Manager.
  3. Select the Home directory and click Go.
  4. Navigate to the tmp/awstats folder.
  5. Move the files to a backup folder for future reference, or delete them from the directory.