1

I am using chronos 3.0.3. When I deploy jobs, it starts running all the jobs instantly on mesos slaves. I want chronos to run only on jobs' scheduled times and not instantly.

How can I configure to prevent running jobs instantly ? If someone can provide any pointer as in where in the chronos code, it is scheduling to run immediately, that will also be a great help.

I have defined epsilon of just 30 minutes in all the jobs, but it does not help; and run all the jobs.

These are all scheduled jobs and not dependent jobs.

Vishwanath
  • 149
  • 2
  • 14

1 Answers1

0

Set the schedule field in your json job definition to run whenever you'd like to run. The format is ISO 8601. For example:

"schedule": "R/2018-09-13T02:00:00.000Z/PT24H",
  • R: Means repeat forever
  • 2018-09-13: Date when you want to start running from
  • 02:00:00.000Z: Time when you want to run your job
  • PT24H: Run every 24 hours.

More info here.

Updating the schedule field to say run in 2 days works for me:

Schedule

Hope it helps.

Rico
  • 58,485
  • 12
  • 111
  • 141
  • Thanks, Rico. But actually, looks like a cron is always run immediately after it is deployed on chronos irrespective of scheduling. Thereafter, it will as per schedule – Vishwanath Sep 19 '18 at 20:14
  • Set the schedule value for a future date/time. Could it be that you are setting the current date and time? – Rico Sep 19 '18 at 20:26
  • 1) Can't we just set it like it should be run only when it is scheduled to run. Also, in the latest version of chronos 3.0.3 "epsilon" has been deprecated. So, now how is chronos calculating whether it has to run a given task immediately when a new job is deployed on chronos / when the chronos comes up ? – Vishwanath Sep 20 '18 at 09:09
  • 2) When I deploy a job to update an existing one in schedule field (meaning updating the time at which it should run), chronos does not update it. This is because chronos does not store the complete schedule of the job when last deployed. Chronos keeps on updating the schedule field of the jobs. So, how can I make chronos to update a job if I have made changes only in the timing on which the cron should run. – Vishwanath Sep 20 '18 at 09:15
  • So if I update the schedule field to run in say 2 days. It works fine for me. (updated answer) Meaning it doesn't run immediately. What does epsilon have to do with running the job instantly? epsilon is if you miss the job a window of time where the job can still be run. – Rico Sep 20 '18 at 16:40
  • Ok so, deploy a job on chronos. Now, update it's schedule field by changing the start-time. Like updating "R/2018-09-13T02:00:00.000Z/PT24H" to "R/2018-09-13T02:11:00.000Z/PT24H" It is not detecting the change. How can I accomplish this ? any idea ? – Vishwanath Sep 21 '18 at 14:02
  • I tried. But even with future dates... Change in just the timing like 2:00 to 2:11 is not detected. This is because chromos updates the schedule field to only PT24. any idea how can I change only time keeping the time internal same – Vishwanath Sep 22 '18 at 17:04