Spring cron expression every 30 minutes

Java spring - I have the following cron expression for a cron job.

0 0/35 * * * ? 

But the above cron expression works once per hour and looks like this

1:35 2:35 3:35 4:35

I want to shoot every 35 minutes instead of once an hour

any quick suggestion?

+4
source share
2 answers

Cron Syntax

 sec min hour day day_of_month month day_of_week year 

So what do you want

 0 0,35 * * * * ? 

Thus, it is triggered in minutes 0 and 35 of each hour.

See Quartz docs for this, as Spring uses Quartz as a scheduler. These documents also explain special characters like *? - and others.

+5
source

You specified an increment instead of two values.

There is no minute 35 + 35 = 70 . Replace 0/35 with 0,35 .

+2
source

Source: https://habr.com/ru/post/1387019/


All Articles