Article 593R4 logrotate not working via cron

logrotate not working via cron

by
oliveoyl
from LinuxQuestions.org on (#593R4)
Hi all,

I'm trying to figure out why syslogs are not getting rotated. When I run logrotate manually from root (/usr/sbin/logrotate /etc/logrotate.conf) it works ok. I also tried -f flag to see it that gets things going. But I just checked today and had to rotate them manually again. Any ideas what else to check/fix?

# ls -ltr messages* | tail -4
-rw-------. 1 root root 322880791 Oct 9 10:08 messages-20201008
-rw-------. 1 root root 121203677 Oct 13 05:48 messages-20201012
-rw-------. 1 root root 107448453 Oct 14 06:44 messages-20201013
-rw-------. 1 root root 222266947 Oct 14 06:57 messages

# ls -l /etc/cron.daily/logrotate
-rwxr-xr-x. 1 root root 219 Oct 15 2019 /etc/cron.daily/logrotate

# cat /etc/cron.daily/logrotate
#!/bin/sh

/usr/sbin/logrotate /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

# cat /etc/logrotate.d/syslog
/var/logs/cron
/var/logs/maillog
/var/logs/messages
/var/logs/secure
/var/logs/spooler
/var/logs/kernel
/var/logs/emergency
/var/logs/ldap
/var/logs/boot
{
daily
dateext
dateyesterday
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
rotate 1461
}latest?d=yIl2AUoC8zA latest?i=JR-A95xR1zo:44t983nQwjE:F7zBnMy latest?i=JR-A95xR1zo:44t983nQwjE:V_sGLiP latest?d=qj6IDK7rITs latest?i=JR-A95xR1zo:44t983nQwjE:gIN9vFwJR-A95xR1zo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments