某年,crontab -e 调用一个脚本,但是调用不起来,AIX 6.1
tail -f /etc/adm/cron/log 看到其他一些系统脚本调用起来了,但是调用日期可date日期不一致
在http://www.aixchina.net/club/viewthread.php?tid=32319&page=1找到如下解释:
看來應該是 cron daemon 和 Time zone 間的問題.
剛 man cron , 其中有說到 TZ 的問題 , 如下 :
================================================================
When the TZ environment variable is changed, either with the chtz command, a Web-based System Manager application, or through SMIT, the cron daemon must be restarted. This enables the cron daemon to use the correct time zone and summer time change information for the new TZ environment variable.
Notes:
1 If you have a job scheduled to run between 1:00 AM and 2:00 AM on the day your time zone changes from daylight saving time to standard time your job will run twice.
2 If you have a job scheduled to run between 2:01 AM and 2:59 AM on the day your time zone changes from standard time to day light savings time your job will not run. You can change the time these jobs run, run them manually, or with until the following day to run them. The cron daemon does not need to be stopped. However, if changes are made to the TZ environment variable, kill the current cron daemon so that it automatically respawns and recognizes the new TZ setting.
================================================================
建議重新進行一次 TimeZone 設定程序後, 再直接Kill cron daemon , cron daemon 會自動respawns.
然后我ps -ef|grep cron 然后kill pid ,然后cron会自动重启,然后就好了!