Help understand "cron" timings

I have a rule that I copy/pasted from somewhere else on the forums and it runs hourly.

Time cron “0 0 * * * ?” or // Every Hour

Can someone help me understand how this works? From my reading on the web I’d be expecting this rule to only run once per day at midnight… But it does seem to run every hour…

Yup, that’s hourly. Seconds, minutes hours… So at 0 seconds, 0 minutes every * hour.

“0 0 0 * * * ?” would be midnight every day.

Cron tutorial here:
Docs related to cron triggers:

Edit… Most linux crontab stuff doesn’t use seconds so that’s probably what is throwing you off. Use the quartz docs for reference instead.

1 Like

openHAB makes use of Quartz Cron, which is slightly different from common cron in GNU/Linux.

The biggest difference (that I’m aware of…) is, that quartz cron has the ability to trigger per Second, while GNU/Linux cron will only trigger per Minute.

there is a crontab generator online that use Quartz instead of Crontab: that can be useful for openhab schedules.

1 Like

Thanks guys, that makes more sense!