Run cron job at 12 am in every time zone

半城伤御伤魂 提交于 2019-12-20 07:48:37

问题


So I think there is around 30 minutes between each time zone. I want to run my script cron.php for at 12 am (midnight) for every time zone. How can I do this?

I was looking at this code:

TZ=UTC
* 7 * * * root date | mail root
TZ=CEST
* 7 * * * root date | mail root
TZ=PCT
* 7 * * * root date | mail root

Does this work?

What does any of the code mean?

Any better solution?


回答1:


Most time zones are 1 hour apart, with a couple of exceptions. The above code will run at 7 AM in each of the time zones listed.

It might be better to have a script that runs every hour and just kick that off once in your own time zone



来源:https://stackoverflow.com/questions/44961104/run-cron-job-at-12-am-in-every-time-zone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!