logrotate cannot delete the files whose filename includes opening/closing bracket "[]"

Solution In Progress - Updated -

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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.