cronjobのタイムゾーンの変更

cronjobのタイムゾーンの変更

毎日午前9時(UTC時間)に実行されるcronjobがあります。現在GMT+1なので、現地時間で午前10時に実行されます。タイムゾーンが変更されると(夏時間、DST)、cronjobはまだUTC時間午前9時に実行されますが、ローカル時間午前11時に実行されます。しかし、夏時間の有無にかかわらず、常に10時に実行したいと思います。どうすればいいですか?

ベストアンサー1

これはオペレーティングシステムと使用法によって異なりますcron。これは、最も広く使用されているcron実装では不可能ですvixie/isc cron。からcrontab(5) manpage

LIMITATIONS
       The  cron  daemon  runs with a defined timezone. It currently does not 
       support per-user timezones. All the tasks: system's and user's will 
       be run based on the configured timezone. Even if a user specifies  
       the TZ  environment  variable  in  his crontab this will affect only 
       the commands executed in the crontab, not the execution of the crontab 
       tasks themselves.

おすすめ記事