[root@lock data]# tail -f /var/log/cron
Jun 15 06:50:05 lock crond[8517]: (CRON) INFO (running with inotify support)
Jun 15 06:50:05 lock crond[8517]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Jun 15 06:50:19 lock crontab[8535]: (root) BEGIN EDIT (root)
[root@lock data]# date
Thu Jun 15 02:49:57 EDT 2017
2个时间完全不一致,所以导致我写的一些定时器脚本在错误的时间执行。为了修正2者的差距,第一步是在修改了时区后需要重启crond定时器服务
[root@lock data]# service crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
如果发现时间还是不正确,可能是rsyslog日志服务没有重启,然后在一次重启crond定时器服务
[root@lock data]# service rsyslog restart
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
最后去查询日志发现时间已经修正
[root@lock data]# tail -f /var/log/cron
Jun 15 06:50:39 lock crond[8517]: (CRON) INFO (Shutting down)
Jun 15 06:50:39 lock crond[8569]: (CRON) STARTUP (1.4.4)
Jun 15 06:50:39 lock crond[8569]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 55% if used.)
Jun 15 06:50:39 lock crond[8569]: (CRON) INFO (running with inotify support)
Jun 15 06:50:39 lock crond[8569]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Jun 15 02:54:25 lock crond[8569]: (CRON) INFO (Shutting down)
Jun 15 02:54:25 lock crond[8830]: (CRON) STARTUP (1.4.4)
Jun 15 02:54:25 lock crond[8830]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 74% if used.)
Jun 15 02:54:25 lock crond[8830]: (CRON) INFO (running with inotify support)
Jun 15 02:54:25 lock crond[8830]: (CRON) INFO (@reboot jobs will be run at computer's startup.)