Matthew Spahr
Matthew Spahr

Reputation: 237

Spring @Scheduled cron job

I am looking to fire off a task everyday at 9am. I am getting some funky results. Currently my job looks like this:

@Scheduled(cron = "0 0 9 * * ?")

What is going wrong with this? Is this the correct expression?

Upvotes: 1

Views: 238

Answers (1)

HarishVijayamohan
HarishVijayamohan

Reputation: 598

I believe @Scheduled(cron="0 0 9 * * *") should work. Also make sure that you are on right time zone. Have a look at this video to know different possible ways to use cron expression with @Scheduled.

Upvotes: 2

Related Questions