运行 centos 8 并且必须logrotate
轮换 nginx 的日志。如果我使用“手动运行命令,日志会按预期轮换"logrotate -v /etc/logrotate.conf
,但在作业运行时不会运行。我已通过查看日志文件cron
验证正在运行,如下所示cronjob
/var/log/cron
Oct 26 15:55:01 c22fin2 run-parts[916513]: (/etc/cron.hourly) starting 0anacron
Oct 26 15:55:01 c22fin2 anacron[916522]: Anacron started on 2023-10-26
Oct 26 15:55:01 c22fin2 anacron[916522]: Will run job `cron.daily' in 0 min.
Oct 26 15:55:01 c22fin2 anacron[916522]: Jobs will be executed sequentially
Oct 26 15:55:01 c22fin2 anacron[916522]: Job `cron.daily' started
Oct 26 15:55:01 c22fin2 run-parts[916513]: (/etc/cron.hourly) finished 0anacron
Oct 26 15:55:01 c22fin2 run-parts[916524]: (/etc/cron.daily) starting logrotate
Oct 26 15:55:01 c22fin2 run-parts[916524]: (/etc/cron.daily) finished logrotate
Oct 26 15:55:01 c22fin2 anacron[916522]: Job `cron.daily' terminated (produced output)
Oct 26 15:55:01 c22fin2 anacron[916522]: Normal exit (1 job run)
文件中文件的状态/var/lib/logrotate/logrotate.status
也已更新。似乎没有迹象表明存在问题?