PROBLEM
My Atmail logs are growing too large.
ENVIRONMENT
- On-Premise Server + WebMail Installations: Version 6.0 > Current Version
- Webmail Only Installations: Version 6.0 > Current Version
CAUSE
Configuring Logrotate is critical, so as to reduce the size of the files used by Atmail in the webmail/log directory. To implement logrotate for your server, please do the following:
RESOLUTION
- Create a file in /etc/logrotate.d/ called 'logrotate_atmail_log'
- In the file, put:
/usr/local/atmail/webmail/log/*log {
weekly
rotate 5
missingok
notifempty
sharedscripts
postrotate
/etc/init.d/atmailserver restart >/dev/null 2>&1 || true
endscript
} - Start logrotate:
/usr/sbin/logrotate /etc/logrotate.conf
- This will then manually execute the log rotation process.
The above logrotate options cause the following:
weekly
Log files are rotated if the current weekday is less then the weekday of the last rotation or if more then a week has passed since the last rotation.
rotate 5
Remove log file after 5 rotations.
missingok
Don't error if there is a missing log file.
notifempty
If there is nothing in the log file, don't rotate.
sharedscripts
Run the following script once, instead of once for each log file.
postrotate
Run the following script after log files have been rotated.
/etc/init.d/atmailserver restart >/dev/null 2>&1 || true
Restart atmail services.
endscript
Closes off the postrotate option.
There are many more configuration options that may suit your installation.
This may include adding an entry for other log files (eg the atmail/mailserver/spool/log files as necessary).
Please refer to the official documentation for more information:
http://linuxcommand.org/man_pages/logrotate8.html
Comments