Re: logrotate script not working

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



>
> That's because the MySQL daemon has his hands on the log's file descriptor
> and still write the log while it has been moved by logrotate.
> You will have to add a command to the logrotate definition which causes
> the MySQL daemon to write into a new log file (mysqladmin flush-logs).
> https://dev.mysql.com/doc/refman/5.5/en/log-file-maintenance.html



Cool. Thanks!! I'll give that a try!

Tim

On Thu, Jan 8, 2015 at 2:02 AM, Alexander Dalloz <ad+lists@xxxxxxxxx> wrote:

> Am 08.01.2015 um 03:54 schrieb Tim Dunphy:
>
>> 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?
>>
>
> That's because the MySQL daemon has his hands on the log's file descriptor
> and still write the log while it has been moved by logrotate.
>
> You will have to add a command to the logrotate definition which causes
> the MySQL daemon to write into a new log file (mysqladmin flush-logs).
>
> https://dev.mysql.com/doc/refman/5.5/en/log-file-maintenance.html
>
>  Any ideas, advice and help at all would be appreciated.
>>
>> Thanks
>> Tim
>>
>
> Alexander
>
>
>
>
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B
_______________________________________________
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