# 查看rsyslog配置,关于cron部分
[root@ip-172-31-10-235 nginx]# cat /etc/rsyslog.conf |grep cron *.info;mail.none;authpriv.none;cron.none /var/log/messages # Log cron stuff cron.* /var/log/cron
可以确定/var/log/cron日志是由rsyslog生成。
# 重启rsyslog服务,重新加载系统时间。
[root@ip-172-31-10-235 nginx]# systemctl restart rsyslog.service
# 再次查看任务计划日志
[root@ip-172-31-10-235 nginx]# tail -f /var/log/cron Aug 15 01:01:01 ip-172-31-10-235 CROND[26503]: (root) CMD (run-parts /etc/cron.hourly) Aug 15 01:01:01 ip-172-31-10-235 run-parts(/etc/cron.hourly)[26503]: starting 0anacron Aug 15 01:01:01 ip-172-31-10-235 run-parts(/etc/cron.hourly)[26512]: finished 0anacron Aug 15 01:05:01 ip-172-31-10-235 CROND[26732]: (root) CMD (/data/html/monitor/Centrol/artisan demon:health) Aug 15 01:10:01 ip-172-31-10-235 CROND[27073]: (root) CMD (/data/html/monitor/Centrol/artisan demon:health) Aug 15 01:10:01 ip-172-31-10-235 CROND[27074]: (root) CMD (/usr/lib64/sa/sa1 1 1) Aug 15 01:15:01 ip-172-31-10-235 CROND[27379]: (root) CMD (/data/html/monitor/Centrol/artisan demon:health) Aug 15 01:20:01 ip-172-31-10-235 CROND[27680]: (root) CMD (/data/html/monitor/Centrol/artisan demon:health) Aug 15 01:20:01 ip-172-31-10-235 CROND[27681]: (root) CMD (/usr/lib64/sa/sa1 1 1) Aug 15 01:25:01 ip-172-31-10-235 CROND[27968]: (root) CMD (/data/html/monitor/Centrol/artisan demon:health) Aug 14 21:30:01 ip-172-31-10-235 CROND[28307]: (root) CMD (/data/html/monitor/Centrol/artisan demon:health) Aug 14 21:30:01 ip-172-31-10-235 CROND[28308]: (root) CMD (/usr/lib64/sa/sa1 1 1)
时区正常
在修改完系统时区后,nginx也需要重新reload,否则nginx日志的时区还是旧的系统时区。
原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/5488.html