0

In looking at my /var/log dir, I can see that my mail.log and mail.err files are being rotated.

An increasing digit is appended to the the end of the logs every six days and after the second long, the log file is gzip compressed.

There are no configuration files that I can find in cron.weekly or in /etc/logrotate.d that make any mention of logging the mail logs and so I have no idea what is doing this.

Can somebody please explain tome what is rotating my mail logs? It looks to be the same thing that is rotating the ssylog files that are also located in /var/log

2 Answers 2

2

It's logrotate(8).

In /etc/crontab, this line:

25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

...uses run-parts(8) to run all the scripts in /etc/cron.daily, including /etc/cron.daily/logrotate, which invokes /usr/sbin/logrotate with the configuration file /etc/logrotate.conf, which includes the config files in /etc/logrotate.d, including /etc/logrotate.d/rsyslog... which includes a directive to rotate /var/log/mail.log.

0

For FreeBSD, I tracked mine down to newsyslog. See /etc/newsyslog.conf, /etc/newsyslog.conf.d/, /usr/local/etc/newsyslog.conf.d/.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.