可以通过Logrotate将日志每天定时进行切割。需要维护如下的一份配置文件: /var/log/mysql/*.log { create 644 mysql mysql notifempty daily rotate 5 missingok nocompress sharedscripts postrotate # run if mysqld is running if test -n "`ps acx|grep mysqld`"; then /usr/bin/mysqladmin flush-logs fi endscript }
可以通过Logrotate将日志每天定时进行切割。
需要维护如下的一份配置文件: