Platform:
RHEL 7
logrotate-3.8.6-7.el7_2.x86_64
Background:
On a RedHat Linux server I have a large set of application servers running, and want a uniform logrotate routine for cleaning up log files. Using wildcards is paramount so I don't have to maintain a constantly growing and shrinking list.
Issue:
Combining wildcards, the "missingok" option AND "olddir" does not seem to work. When I define a pattern for debug log files - which may or may not exist - and only use "missingok", everything is fine. If I add the "olddir" option it fails with:
# logrotate -d /etc/logrotate.d/foobar
reading config file /etc/logrotate.d/foobar
olddir is now old_logs
error: /etc/logrotate.d/foobar:28 error verifying log file path /srv/www/servers/*/logs: No such file or directory
removing last 1 log configs
The config file:
/srv/www/servers/*/logs/*_foobar.txt
{
daily
olddir old_logs
missingok
}
I see there has been a long standing fix in http://rhn.redhat.com/errata/RHBA-2008-0703.html fixing the issue with wildcard and missingok, but has anybody seen or fixed the issue with olddir?
I'm considering skipping olddir and using postrotate + find/mv, but I would like not having to do that.