crontab執行時區與系統時間不一致問題

2021-09-02 20:42:46 字數 1919 閱讀 5882

[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.)

crontab執行時區與系統時間不一致問題

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 zabb...

執行時異常與檢查時異常

檢查時異常為語法錯誤或邏輯錯誤 執行時異常編譯器不檢查但在執行時會影響後面 的執行 1.nullpointerexception 空指標異常 2.arithmeticexception 數學異常 3.arrayindexoutofbound ception 陣列越界 4.securityexcept...

iOS編譯時型別與執行時型別

首先我們來寫乙個物件 nsstring obj nsdata alloc init 一般來說我們寫完上面的 xcode會為我們提示乙個warning incompatible pointer types intializing nsstring with an expression of type ...