[root@zabbix tmp]# tail -f -n 1 /var/log/cron
Oct 27 22:15:01 zabbix CROND[32037]: (cacti) CMD (/bin/php /var/www/html/cacti/poller.php > /tmp/cacti.log 2>&1)
[root@zabbix tmp]# date
Wed Oct 28 10:16:15 CST 2015
原因是系统时区修改后,必须重启crontab服务才会生效
[root@zabbix tmp]# service crond restart
如果这时还没有生效
查看其它日志文件日期,如果全部都有问题,说明是rsyslogd服务的日志没有生效
[root@zabbix log]# systemctl restart rsyslog
[root@zabbix log]# tail -f /var/log/messages
Oct 27 22:27:01 zabbix systemd: Started Session 1416 of user root.
Oct 27 22:28:01 zabbix systemd: Starting Session 1417 of user root.
Oct 27 22:28:01 zabbix systemd: Started Session 1417 of user root.
Oct 27 22:29:01 zabbix systemd: Starting Session 1418 of user root.
Oct 27 22:29:01 zabbix systemd: Started Session 1418 of user root.
Oct 27 22:29:03 zabbix rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="595" x-info=""] exiting on signal 15.
Oct 28 10:29:03 zabbix rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="17278" x-info=""] start
Oct 28 10:29:03 zabbix systemd: Stopping System Logging Service...
Oct 28 10:29:03 zabbix systemd: Starting System Logging Service...
Oct 28 10:29:03 zabbix systemd: Started System Logging Service.
[root@zabbix log]# tail -f /var/log/cron
Oct 27 22:23:01 zabbix CROND[17186]: (root) CMD (date > /tmp/date.log)
Oct 27 22:24:01 zabbix CROND[17192]: (root) CMD (date > /tmp/date.log)
Oct 27 22:25:01 zabbix CROND[17205]: (root) CMD (date > /tmp/date.log)
Oct 27 22:25:27 zabbix crond[17222]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 89% if used.)
Oct 27 22:25:27 zabbix crond[17222]: (CRON) INFO (running with inotify support)
Oct 27 22:25:27 zabbix crond[17222]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Oct 27 22:26:02 zabbix CROND[17226]: (root) CMD (date > /tmp/date.log)
Oct 27 22:27:01 zabbix CROND[17231]: (root) CMD (date > /tmp/date.log)
Oct 27 22:28:01 zabbix CROND[17238]: (root) CMD (date > /tmp/date.log)
Oct 27 22:29:01 zabbix CROND[17272]: (root) CMD (date > /tmp/date.log)
Oct 28 10:30:01 zabbix CROND[17288]: (root) CMD (date > /tmp/date.log)
现在日志对了.
阅读(4870) | 评论(0) | 转发(0) |