Apparently Jeninks is using the cron format , common on Linux systems. So, what your statement is saying is: "Run the task once every minute (% with%) of the hour% with%, every day (% with%), every month (% with%), any day week (% with%) ". For your task to run every 3 hours, one way would be:
0 0,3,6,9,12,15,18,21 * * *
Detailing:
-
*
- the task will always run at zero minute (accepts 3
);
-
*
- the task will run at zero hour, at three, at six ... (accepts *
);
-
*
- the task will execute every day (accepts 0
);
-
0-59
- the task will execute every month (accepts 0,3,6,9,12,15,18,21
);
-
0-23
- the task will run any day of the week (accepts *
, where 1-31
is "sunday").
That is, you specify what time of the hour you want it to run, and at what time. The rest you leave as *
(applies to all). The second statement (time) can be simplified as follows:
0 */3 * * *
In this case, the 1-12
means "every three hours" - but without specifying the starting time. In this case, I'm not sure what times the task would run, except that there will be a 3-hour interval between one run and another.
This *
can also be replaced by an explicit range. A more complex example:
15 0-6/2 * * 0,3
"Every Sunday and every Wednesday, every two hours at dawn, at the 15th minute" That is: 0-6
, 0
, *
and */3
(notice the interval is closed) / p>
Note: This answer assumes that Jenkins implements the Cron correctly and completely; if only one subset is supported, some of the above options may not be available. I suggest you run some tests to determine if a particular statement works as expected.