logrotate cannot delete the files whose filename includes opening/closing bracket "[]"
Issue
The log files whose filename includes opening/closing bracket "[]" are not deleted even if " rotate 5" is set in the logrotate config file .
messages-[192.168.100.100].log
messages-[192.168.100.100].log-20160711
messages-[192.168.100.100].log-20160712
messages-[192.168.100.100].log-20160713
messages-[192.168.100.100].log-20160714
messages-[192.168.100.100].log-20160715
messages-[192.168.100.100]-20160716
logrotate config file
/logs/messages*.log {
copytruncate
rotate 5
ifempty
dateext
missingok
}
Environment
- Red Hat Enterprise Linux
- 5
- 6
- 7
- logrotate
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.