node-cron icon indicating copy to clipboard operation
node-cron copied to clipboard

unable to run every x minutes

Open jomapps opened this issue 4 years ago • 4 comments
trafficstars

Hi, Thank you everyone involved for their contribution.

0 */10 * * * * is given in the example for cron to run every 10 min.

This runs every 10 min but for every second !!! So it runs the function 60 times !! Then it waits 10 min and does that again.

Also tried following combinations without success:

  • */10 * * * * 1-59 */10 * * * *

Can you advise?

Thanks TeaCii

jomapps avatar Dec 01 '20 21:12 jomapps

Hi, Thank you everyone involved for their contribution.

0 */10 * * * * is given in the example for cron to run every 10 min.

This runs every 10 min but for every second !!! So it runs the function 60 times !! Then it waits 10 min and does that again.

Also tried following combinations without success:

  • */10 * * * * 1-59 */10 * * * *

Can you advise?

Thanks TeaCii

Hi. I don't know if I understood your question correctly, but come on. 0 * / 10 * * * * causes the function to run every 10 minutes.

If you want it to be executed every second you must use * * * * * * as example in examples/is_job_running.js

HeitorGonzaga avatar Dec 02 '20 00:12 HeitorGonzaga

HI, You understood it right. I want to run every 10 min. And 0 */10 * * * * Runs every 10 min but 60 times. Rephrased, it runs 60 times every 10 min.

No I do not want it executed every second. So something is obviously up.

jomapps avatar Dec 02 '20 11:12 jomapps

Dear @jomapps If you run every 10 minutes. Your cron expression is wrong. It should be */10 * * * * Check at https://crontab.guru/every-10-minutes

kaungyeehein avatar Sep 19 '21 17:09 kaungyeehein

@kaungyeehein that is incorrect, this library has an extra field for seconds which crontab guru does not account for.

Every 10 minutes is 0 */10 * * * *

C-o-d-e-C-o-w-b-o-y avatar May 06 '22 07:05 C-o-d-e-C-o-w-b-o-y