I have one job that needs to be execute twice a day at different time . e.g. 10:00 and 15:30. How can i achieve this ?
I am confuse because minute is different for both the time. For 11:00 and 15:00 its easy because for both the times, minute portion is same, but for the different minute portion is it feasible with cron ?
Thanks in Advance and apologies for silly question.
It is a wildcard for every part of the cron schedule expression. So * * * * * means every minute of every hour of every day of every month and every day of the week .
1 Answer. The cron statement for each script execute on the same days - */2 evaluates to 1-31/2 . See my answer here for more details. To get alternating days, you could use 2-31/2 for the first script - this would start at 2 and skip every other for 2,4,6 etc.
We can run several commands in the same cron job by separating them with a semi-colon ( ; ). If the running commands depend on each other, we can use double ampersand (&&) between them. As a result, the second command will not run if the first one fails.
Meaning of cron expression 0 * * * * *? I think it means the scheduler is expected to run every seconds.
Try following which you will get closest in one expression
0 0 10,15/12 * * ?
this will run 10:00 and 15:00.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With