Why does my CentOS logrotate run at random times?

The key is knowing that CentOS runs the scripts in /etc/cron.{daily,weekly,monthly} from anacron… /etc/anacrontab is setting RANDOM_DELAY, which does what you might expect (it delays up to RANDOM_DELAY minutes before starting the job)… # /etc/anacrontab: configuration file for anacron # See anacron(8) and anacrontab(5) for details. SHELL=/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # the maximal random delay added … Read more

Logrotate does not remove old logs

your configuration says: rotate 2 that means log files are rotated 2 times before being removed, so logrotate only cares about 2 files. my guess is that the configuration was changed at some point, because previously more log files were kept, maybe it was something like rotate 28. these older files you have to remove … Read more