I'm using logrotate to rotate my log file periodically (in my case every 1 hour checking for log file size and rotate if needed using cron). I'm facing a serious issue in it.
The following files should have been created -- user.log.gz.4, user.log.gz.3, user.log.gz.2, user.log.1, user.log.
But sometimes any one of the file goes missing, sometimes file contents are missing at the end of the file, and sometimes the content of the files are repeating. It's strange. Please can someone help me solve the issue.
My logrotate Configuration:
/var/log/project_name/*.log {
size 512M
copytruncate
rotate 30
compress
notifempty
missingok
}