I need to run a CRON at midnight which auto-assigns some periodic tasks for the people working in my company. The situation I am facing is that my company basically has offices all around US, which has more than 1 timezone. So basically I would want the job to be done timezone-specific. Also, my server is running by UTC.
If I set EDT as the base timezone (which is 4 hours behind UTC) and set the CRON to be triggered at midnight, the CRON time would be
0 0 4 * * ?
The possible way that I think can be is that instead of setting it just once, I set it to be triggered 7 times at the following times:
0 0 4 * * ? [EDT]
0 0 5 * * ? [CDT]
0 0 6 * * ? [MDT]
0 0 7 * * ? [PDT]
0 0 8 * * ? [AKDT]
0 0 9 * * ? [HADT]
0 0 10 * * ? [HST]
So once any of it triggers, it would check which of my offices come under this time zone and will do the job.
This may work, as I believe, but does anyone else have any other option instead of this? Also, I would need to fix for the Daylight saving, which I am not really sure about how I would want to do.