Mr Gwent
Mr Gwent

Reputation: 57

Cron trigger issue with Quartz

Can anyone tell me if a Cron expression of 1 0 * * * ? will mean that a Quartz job in Java runs at one second past the hour, every hour?

I always seem to get these wrong.

Upvotes: 2

Views: 345

Answers (1)

Erick Robertson
Erick Robertson

Reputation: 33078

Yes, one second past the hour, every hour, but you're missing a *.

The parameters for a cron line in quartz are:

  • seconds of hour (0-59)
  • minute of hour (0-59)
  • hour of day (0-23)
  • day of month (1-31)
  • month of year (1-12)
  • day of week (1-7, 7 is Saturday)
  • (optional) year

So you would need six or seven values:

1 0 * * * *

Upvotes: 1

Related Questions