1

Hello guys

I want to work my schedule at every minute between 8am - 10pm. I tried that code.

@Scheduled(cron = "0 */1 8-22 * * MON-FRI")

But it doesn't work! I am confused. Help me!

Nyamkhuu Buyanjargal
  • 621
  • 2
  • 11
  • 29

1 Answers1

5

you can find out crontab information StackOverflow link

These are valid formats for cron expressions:

0 0 * * * * = the top of every hour of every day.
*/10 * * * * * = every ten seconds.
0 0 8-10 * * * = 8, 9 and 10 o'clock of every day.
0 0 6,19 * * * = 6:00 AM and 7:00 PM every day.
0 0/30 8-10 * * * = 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.
0 0 9-17 * * MON-FRI = on the hour nine-to-five weekdays
0 0 0 25 12 ? = every Christmas Day at midnight

The pattern is:

second, minute, hour, day, month, weekday
Taeho Kang
  • 76
  • 2