#vim /etc/logrotate.d/mysql-log-rotate /var/log/mysql-slow.log { # create 600 mysql mysql notifempty daily rotate 3 missingok compress postrotate # just if mysqld is really running if test -x /usr/local/mysql/bin/mysqladmin && \ /usr/local/mysql/bin/mysqladmin ping &>/dev/null then /usr/local/mysql/bin/mysqladmin flush-logs fi endscript }
以下のコマンドで確認します。
logrotate -dv /etc/logrotate.d/mysql-log-rotate