I am trying to create a timer trigger which will run every 100 hours interval.I have tried implementing 0 0 */100 * * *
but it is triggering it every day. I have very basic idea about cron expression but couldn't formulate the actual expression for the same.
Asked
Active
Viewed 105 times
0

Akash
- 25
- 7
-
Does this answer your question? [Cronjob every 25 hours?](https://stackoverflow.com/questions/1417098/cronjob-every-25-hours) – Selcuk Dec 05 '22 at 06:17
-
The solution posted there are asking me to write a separate shell script to achieve it. My question is can I not get it done with the existing cron expression? – Akash Dec 05 '22 at 06:24
1 Answers
0
100 hours == 4 days + 4 hours
Suppose the job starts to execute at 00:00 AM, then you can try 0 4 */4 * *
which means 'At 04:00 on every 4th day-of-month'.

Albina
- 1,901
- 3
- 7
- 19
-
Are you suggesting `0 0 4 */4 * *` ? (I think you are missing one in the expression.) But the interval won't be of 100 hours if I do that. – Akash Dec 05 '22 at 10:20
-
@Akash in my answer cron was built according to UNIX Cron Format. It consists of 5 fields (no field for 'seconds'). Which type of cron expression do you use? If you add another 0 to the leftmost part as you mentioned ('second' field), cron will mean `At 04:00:00 on every 4th day-of-month`. 100 hours depend on when you are going to schedule this cron expression ('hour' field can vary). – Albina Dec 05 '22 at 10:41
-
I am using the cron expression in Azure Function Timer trigger, if I use your expression it would start the trigger 4 days later at 4 a.m. and the remaining will be just a 4 day gap, meaning 96 hours. – Akash Dec 05 '22 at 11:15