I have below configuration for access logs
cat /etc/logrotate.d/logrotate_nginx.conf
/nginx/access/logs/*.log {
rotate 2
size 1k
missingok
compress
notifempty
copytruncate
}
There is no time interval configuration.
This should mean it has rotate logs at '/nginx/access/logs/' after they reach 1 KiloByte right?
But this is the log rotation now
/ # ls -l /nginx/access/logs/
total 8
-rw-r--r-- 1 root root 1264 Jun 24 11:17 nginx-access.log
-rw-r--r-- 1 root root 1292 Jun 24 11:17 nginx-access_withbody.log
-rw-r--r-- 1 root root 0 Jun 24 11:16 nginx-error.log
This is logrotate.status
/ # cat /var/lib/logrotate.status
logrotate state -- version 2
"/var/log/acpid.log" 2019-6-24-11:0:0
"/mnt/mesos/sandbox/logs/nginx-error.log" 2019-6-24-11:0:0
"/mnt/mesos/sandbox/logs/nginx-access.log" 2019-6-24-11:0:0
"/mnt/mesos/sandbox/logs/nginx-access_withbody.log" 2019-6-24-11:0:0
I want to know why it is not rotating. If the issue is with conf. And as per document
This option is mutually exclusive with the time interval options, and it causes log files to be rotated without regard for the last rotation time, if specified after the time criteria
logrotate
started? Did it run again after the files reached 1k in size?