How To: Auto-Clean Logwatch

  Email

Ticket Example : MHL-956-32120

Logwatch is a customizable log analysis system. Logwatch parses through your system’s logs and creates a report analyzing areas that you specify. Sometimes, user are unable to access their webmail or send/receive emails due to the cache in the logwatch. You can clean the logwatch and set auto-clean so that you do not have to do it again next time after you have configured the auto-clean.

First, you can check which directory is full. Type,


df -h

Once you verify which directory, go to the directory and go to the cache file to see the logwatch


cd /var/cache/logwatch/

You can list-out the list logwatch. To remove it, type


rm -rf logwatch.*

In order to check if user are able to send out or receive mail after removing the logwatch, you can create a test account in the webmail and try to send in/out email. Check if the delivery is completed or not.


cat /var/log/exim/mainlog | grep ips1

Second, you can also set auto-clean logwatch so that you do not have to clean manually each day. To set auto-clean, type


crontab -e

Add the line below and save


02 4 * * * find /var/cache/logwatch/ -mtime +2 -exec /bin/rm {} \;