Issue
I want to set Jenkins to run a job every 3rd minute, but not starting at 0. Basically, I have 3 jobs and I want to cycle through them each minute.
The first job I can run every 3rd minute with */3 * * * *
. But the second I tried 1/3 * * * *
and it failed with hudson.remoting.ProxyException: line 1:2: unexpected token: /
How do I write this expression?
Solution
I think you're looking for:
- job 1:
0-57/3 * * * *
- job 2:
1-58/3 * * * *
- job 3:
2-59/3 * * * *
Think of the cron minute entry as meaning "range/step" (or, "run this every step minutes over the minute range start-end)
Reference: I was able to figure it out from this excellent answer, which includes some helpful related links and a more in-depth explanation.
Answered By - bto