简体   繁体   中英

When does this @Scheduled(cron = "0 0 0/24 * * ?") get called?

I found this @Scheduled(cron = "0 0 0/24 * *?") on top of a scheduler. Also there was a comment saying this runs every day. But i am not convinced how.

I know that Cron expression looks like

<minute> <hour> <day-of-month> <month> <day-of-week> <command>

But I am not able to relate 0/24 to. Can anyone add here?

Refer to Spring Docs . Spring's Cron expression is different with linux. It's look like:

<Seconds> <Minutes> <Hours> <DayofMonth> <Month> <DayofWeek> <Year>

0/24 mean start at 0 o'clock and repeat it after 24 hours

Cron expression:

<Seconds> <Minutes> <Hours> <Day Of Month> <Month> <Day Of Week> <Year>

You can refer to:

* * *? * * Every second

0 * *? * * Every minute

0 0 13 * *? At 13:00:00pm every day

0 0 */6? * * Every six hours

0 0 *? * * Every hour

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM