Magento Cron Tab Job Time zone
Im trying to figure out if my module cron is running at the correct time.
The cron for my module is set at 1am (0 1 * * *), the time zone of the default store is Western Europe (Paris, Berlin etc GMT +2), the server time is EDT (Eastern Daylight Time).
开发者_如何转开发So on which time zone is the 1am schedule based on?
Thanks,
The Magento cron process runs under the UTC timezone.
This can be verified by temporarily adding a small log statement to the cron observer.
The method is:
Mage_Cron_Model_Observer::dispatch()
Look for this code in the first few lines:
$now = time();
Either right before or after, add this:
Mage::log("cron timezone: " . date_default_timezone_get(), Zend_Log::DEBUG);
Then check your var/log/system.log file and you will see that PHP/Magento is using the UTC timezone.
The Magento cron job log times are recorded in UTC. Actual run times are based off the TZ offset (server time). Here's a Cron Job Monitor script that shows you the jobs as they're scheduled and then their completion times. It also gives you UTC, the server time and your store time (single store). All three can be different. Cron Job Monitor
For it to be useful, I set System Config to keep errors and logged information for 24 hours. That way you can actually monitor the big jobs that run in the early AM and confirm they're really running.
精彩评论