On RedHat, I have a logrotate configuration as follows :
/custom/path/kibana/logs/*.log {
missingok
daily
create 0644 suuser suuser
rotate 7
notifempty
sharedscripts
compress
dateext
dateformat -%Y%m%d%s
su suuser suuser
postrotate
/bin/kill -HUP $(cat /custom/path/kibana/run/kibana.pid 2>/dev/null) 2>/dev/null
endscript
}
I ran logrotate with debug and force flags to verify it would run fine. And it actually rotated my log file. So I thought everything was fine in my config.
But then, during crontab run, I saw the next day that the logs were not rotated. I tried to run logrotate in debug mode and got this message :
log does not need rotating (log has been already rotated)not running postrotate script, since no logs were rotated
I removed the logrotate.status file having in mind that during next crontab run it would run from scratch and get back to normal. But the day after, I noticed that my log files targeted by the above config were not present in the logrotate.status file and that I still have the same message when trying to run manually saying that log has been already rotated.
I'm very confused especially given the fact that when I add a size criteria in my config, it runs fine !
Would you guys please have an explanation ?
Thanks a lot for your help and explanations.
Kind regards,
Pierre