(This message has been automatically imported from the retired mailing list)
Hello,
I’m trying to figure out how best to tackle updating a cron-style job’s
definition between time-zones in terms of GUI, how to make it most
convenient to use. Would appreciate your input.
We’ve got two fields:
- Start time
- Definition itself
Start time is always in a user’s timezone and there is nothing to change
on this front.
However, let’s say we are UTC+4 and the definition is:
- 2 * * *
Which is - each minute, between 02:00-02:59, each day of month, each
month, each day of week.
Now its canonical version in UTC would be * 22 * * * and the start time
would ensure the correct 22 hours were used to fire a job the first time.
If now the user changes the TZ to UTC-7 the definition would on GUI read
- 15 * * * (still * 22 * * * internally).
Things begin to look interesting if time spans and days of week or month
are added.
Again, a user in UTC+4 defines 15 2-5 * * 5 - which is:
- Each month
- Each day of month
- Only Fridays
- At 02:15, 03:15, 04:15 and 05:15
In UTC this becomes:
- Each month
- Each day of month
- Either on Thursdays 22:15 and 23:15 or on Fridays 00:15 and 01:15
Trouble is, I’m not even sure if for the purposes of being displayed in
web-admin this can be converted into a single valid cron expression in
- Cron as such
- The crontab library we are using under the hood
Same would go for similar cases that straddle boundaries between days or
months.
The promise is to support a wide range of expressions so I wouldn’t want
to limit what the scheduler can handle.
For 2.1, I’m considering the addition of a separate field to cron-style
jobs that would indicate the TZ a given definition is in.
By default, when a job is created, it would be set to the user’s
selected TZ.
But if a user’s time-zone got changed, the definition’s TZ would not
change so as not to end up with a definition we cannot express.
What do you think? Would everyone be satisfied with such an approach?
thanks,