[CentOS] logrotate script not working

Sun Jan 11 21:41:21 UTC 2015
SilverTip257 <silvertip257 at gmail.com>

On Wed, Jan 7, 2015 at 9:54 PM, Tim Dunphy <bluethundr at gmail.com> wrote:

> Hey guys,
>  Got a quick question and I hope this is an easy one!
>  In my /etc/logrotate.conf file I have the following entry:
>  # rotate all of the apache logs  -- we'll rotate them here
> /var/log/mysqld.log  {
>     weekly
>     size  50M
>     create 0644 mysql mysql
>     rotate 1
> }
> And from that I would expect the log to rotate when it reaches 50M in size.
> However I just caught that log weighing in at 356MB!!  So how can I get
> this log file to rotate when it hits 50MB?

Given the other replies and your description...
(You already have this solution as your answer.  But I find it interesting
to read others' solutions and determine if mine could use improvement.)


> Any ideas, advice and help at all would be appreciated.

I'm a bit late on replying to this one ... in the past I've handled
_binary_ log file (for replication) rotation via MySQL itself.
* I realize the OP did not indicate he's using sql replication.  But maybe
this is helpful to somebody.

In my case it was in regards to binary replication logs and specifically
how many were retained (when MySQL began to purge).  I also didn't blink at
letting the logs grow to 1GB (the default for that version) but the size
was configurable as well.



//  SilverTip257  //