centos8 – logrotate in centos does not rotate logs

Running centos 8 and have logrotate to rotate my logs for nginx. The logs rotate as expected if I run the command manually using "logrotate -v /etc/logrotate.conf“, but do not run when the cron job runs. I have validated that the cronjob is running by viewing the /var/log/cron log file as shown

Oct 26 15:55:01 c22fin2 run-parts[916513]: (/etc/cron.hourly) starting 0anacron
Oct 26 15:55:01 c22fin2 anacron[916522]: Anacron started on 2023-10-26
Oct 26 15:55:01 c22fin2 anacron[916522]: Will run job `cron.daily' in 0 min.
Oct 26 15:55:01 c22fin2 anacron[916522]: Jobs will be executed sequentially
Oct 26 15:55:01 c22fin2 anacron[916522]: Job `cron.daily' started
Oct 26 15:55:01 c22fin2 run-parts[916513]: (/etc/cron.hourly) finished 0anacron
Oct 26 15:55:01 c22fin2 run-parts[916524]: (/etc/cron.daily) starting logrotate
Oct 26 15:55:01 c22fin2 run-parts[916524]: (/etc/cron.daily) finished logrotate
Oct 26 15:55:01 c22fin2 anacron[916522]: Job `cron.daily' terminated (produced output)
Oct 26 15:55:01 c22fin2 anacron[916522]: Normal exit (1 job run)

The status is updated for the file in the /var/lib/logrotate/logrotate.status file as well. There seems to be no indication of an issue?

Read more here: Source link