Re: logrotate script not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Jan 7, 2015 at 9:54 PM, Tim Dunphy <bluethundr@xxxxxxxxx> 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...
http://www.question-defense.com/2009/12/20/configure-logrotate-to-rotate-and-flush-mysql-logs-without-a-password
(You already have this solution as your answer.  But I find it interesting
to read others' solutions and determine if mine could use improvement.)

http://www.percona.com/blog/2014/11/12/log-rotate-and-the-deleted-mysql-log-file-mystery/
http://www.percona.com/blog/2013/04/18/rotating-mysql-slow-logs-safely/
http://forums.cpanel.net/f354/large-general-log-file-how-clean-up-safely-stop-reoccuring-278392.html
http://ronaldbradford.com/blog/the-correct-approach-to-rolling-mysql-logs-2010-02-22/


>
> 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.

max_binlog_size
expire_logs_days

http://dev.mysql.com/doc/refman/5.0/en/purge-binary-logs.html
http://dev.mysql.com/doc/refman/5.0/en/log-file-maintenance.html

-- 
---~~.~~---
Mike
//  SilverTip257  //
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux