T. Rex T. Rex - 2 months ago 9
Node.js Question

Run Cron Job every 45 minutes with Node-Cron

I'm using node-cron to run scheduled jobs.
I want the jobs to run every 45 minutes, but its acting strangely

Here's the pattern I'm using

'00 */45 * * * *'


I started my script at
Tue Jun 17 2014 08:17:39 GMT+0000 (GMT)


Here's are the first couple of times the job was executed

1. Tue Jun 17 2014 08:45:03 GMT+0000 (GMT)


2. Tue Jun 17 2014 09:00:01 GMT+0000 (GMT)


3. Tue Jun 17 2014 09:45:02 GMT+0000 (GMT)


This is definitely not what I expected or want.
All I want is to run the Jobs every 45 minutes.
Can anyone help me with the pattern?
Thanks :)

Answer

You're probably looking for

0 */45 * * * *

The ranges are here.

  • Seconds: 0-59
  • Minutes: 0-59
  • Hours: 0-23
  • Day of Month: 1-31
  • Months: 0-11
  • Day of Week: 0-6
Comments