Conditions:
- A log file remains empty.
- A log file with the same base name with timestamp added keeps growing, remains active and is never rotated.
In the following example, the file to rotate is /var/log/messages
.
# ls -ltr /var/log/messages*
-rw------- 1 root root 205K Sep 3 2023 messages-20230903.gz
-rw------- 1 root root 181K Sep 10 2023 messages-20230910.gz
-rw------- 1 root root 0 Sep 17 2023 messages
-rw------- 1 root root 109M Jul 11 07:26 messages-20230917