Cron Expression to execute cron triggers for 12 hours of a day?
-
25-09-2019 - |
Question
I need a cron-expression (0 0/60 * * * ?) to fire application every 12 hours (twice a day).
Solution
Use e.g. 0 0 3,15 * * ?
That'll run a job at 3am and 3pm. That's twice a day, with 12 hours between.
You could use 0 0 0/12 * * ?
which means every 12 hours. Here's some examples.
OTHER TIPS
Some examples that fit your criteria:
30 */12 * * *
runs at 00:30:00 and 12:30:00 each day
0 3-15/12 * * *
runs at 03:00:00 and 15:00:00 each day
23 4,16 * * *
runs at 04:23:00 and 16:23:00 each day
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow