User Tools

Site Tools


mysql_slow_query_rotate

logrotate -fv /etc/logrotate.d/mysqld 
Logrotate file:

/san/mysqllogs/slowlogs/slow-log {
        create 640 mysql mysql
        notifempty
        daily
        rotate 5
        missingok
        #compress
    postrotate
	# just if mysqld is really running
	if test -x /usr/bin/mysqladmin && \
	   /usr/bin/mysqladmin --defaults-file=/root/.my.cnf ping &>/dev/null
	then
	   /usr/bin/mysqladmin --defaults-file=/root/.my.cnf flush-logs
	fi
    endscript
}
mysql_slow_query_rotate.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki