Symptoms
The following notification/alert email is received:
Subject: Anacron job 'cron.daily' on $DOMAIN.TLD
/etc/cron.daily/logrotate:
error: libcare:3 bad rotation count '5 # keep 5 last archives'
error: found error in /var/log/libcare/*.log , skipping
Description
The issue is related to an incorrectly formatted comment in this logrotate configuration file from the Kernelcare package:
cat
/etc/logrotate.d/libcare
/var/log/libcare/*.log {daily
rotate 5 # keep 5 last archives
missingok # it's ok if there is no such file
notifempty # do nothing if file is empty
compress
}
As seen here this file is responsible to rotate the log files in this directory: /var/log/libcare/
The logrotate command is configured to run every day and when it runs the above configuration is consequently triggered:
cat
/etc/cron.daily/logrotate
#!/bin/sh
export TMPDIR=/var/spool/logrotate/tmp
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0
You can reproduce the issue by running the above command manually and tailing the cron log file like this:
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf; tail -f /var/log/cron
error: libcare:3 bad rotation count '5 # keep 5 last archives'
error: found error in /var/log/libcare/*.log , skipping
Oct 8 06:54:01 server CROND[12752]: (root) CMD (/usr/bin/jetcli backup --run backup > /dev/null 2>&1)
Oct 8 06:54:01 server CROND[12754]: (root) CMD (/usr/bin/jetcli backup --run snapshots > /dev/null 2>&1)
........
Workaround
There is a simple workaround this issue and that is to simply remove the comment "# keep 5 last archives
" after the rotation count " rotate 5
" in this file:
/etc/logrotate.d/libcare
This will stop the error messages.
Comments
0 comments
Article is closed for comments.