cron.daily(and .weeklyand .hourly) 中的条目何时运行,是否可配置?
我还没有找到一个明确的答案,希望有一个。
我正在运行 RHEL5 和 CentOS 4,但对于其他发行版/平台也很好。
我有这个 logrotate 配置,我在 Ubuntu 10.04 上运行。
/var/log/mysql/mysql-slow.log {
daily
rotate 3
compress
notifempty
missingok
create 660 mysql adm
postrotate
if test -x /usr/bin/mysqladmin && \
/usr/bin/mysqladmin ping &>/dev/null
then
/usr/bin/mysqladmin flush-logs
fi
endscript
Run Code Online (Sandbox Code Playgroud)
}
我昨天把它放在 /etc/logrotate.d 中,今天日志没有轮换。
以下是我所做的事情:
当我这样做时:
$ logrotate -d -f mysql-slow
reading config file mysql-slow
reading config info for /var/log/mysql/mysql-slow.log
Handling 1 logs
rotating pattern: /var/log/mysql/mysql-slow.log forced from command line (3 rotations)
empty log files are not rotated, …Run Code Online (Sandbox Code Playgroud)