1

Topic: logrotate does not seem to work via cron

==== Required information ====
- iRedMail version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Linux/BSD distribution name and version:
- Related log if you're reporting an issue:
==== ==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian Squeeze
- Related log if you're reporting an issue: see below
====

Hi Zhang,

I use Debian Squeeze and logrotate does not seem to be called via cron. My log files grew very big.
Today I did some research:

- in /etc/crontab it says
  16 0 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
- in /etc/cron.daily/logrotate it says:
  #!/bin/sh
  test -x /usr/sbin/logrotate || exit 0
  /usr/sbin/logrotate /etc/logrotate.conf
- in syslog I see
  Dec 17 01:16:01 www /USR/SBIN/CRON[13319]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ))
  No more warnings or error messages then concerning logrotate.

So I see in syslog that anacron tries to run scripts in cron.daily, but logs are NOT rotated, they still grow.

If manually run "/usr/sbin/logrotate /etc/logrotate.conf" all is fine and all logs are rotated.
Any ideas?

Best regards,
Oliver

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: logrotate does not seem to work via cron

Do you have service "cron" running?

3

Re: logrotate does not seem to work via cron

ZhangHuangbin wrote:

Do you have service "cron" running?

yes:

root@www:~# ps ax | grep cron
 1400 ?        Ss     1:22 /usr/sbin/cron
30642 pts/0    R+     0:00 grep cron

And other cron jobs run ok.

4

Re: logrotate does not seem to work via cron

No idea yet, sorry. sad
Please try to perform some more debugs yourself to figure it out.