[CentOS] Silly logrotate question

Wed Oct 19 09:14:35 UTC 2011
John Kennedy <skebi69 at gmail.com>

Ok, I have Googled this and either I am not asking the right way or I just
can't see what's in front of me (sorry)...

We have log files called app.2011-10-119.log (with the date changing every
day). The log is created by the application each day at midnight.
I have logrotate set to rotate files ending in .log at 4am, with
copytruncate on by default.
If I list the files I see all the old app.2011-10-<X>.log files with a 0
file size.
If I turn off copytruncate, the current days log file will be removed
everyday at 4am.

How can I satisfy both the need to remove yesterday's log file while keeping
the current day?

Here is the logrotate file:

/var/log/app/*.log {
    rotate 10
    create 0644 user user

I added notifempty to keep the old empty log files from being compressed...


 John Kennedy