Run cron job at 12 am in every time zone

2019-03-07 10:04发布

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条回答
2楼-- · 2019-03-07 10:31

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

查看更多
登录 后发表回答