Cron expression to run after 30 minutes past hour

11k views Asked by At

I would like to schedule a job using Quartz to run 30 minutes past the hour. For example I want the job to run at 00:30, 1:30, 2:30 and so on.

Can you guys help me to get the correct cron expression?

1

There are 1 answers

5
Sotirios Delimanolis On

Simple enough

30 * * * *

Every 30th minute of every hour, every day of the month, every month, every day of the week. From wikipedia

# *    *    *    *    *  [command to execute]
# ┬    ┬    ┬    ┬    ┬
# │    │    │    │    │
# │    │    │    │    │
# │    │    │    │    └───── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names)
# │    │    │    └────────── month (1 - 12)
# │    │    └─────────────── day of month (1 - 31)
# │    └──────────────────── hour (0 - 23)
# └───────────────────────── min (0 - 59)

For quartz, the cron expression introduces more fields (7 total), the first being seconds and the last being years (but optional). You can see those here.

You need

* 30 * * * * [*]