-1

I would like to make a cron that runs every day from 8am to 11pm.

const cron = require('node-cron');

cron.schedule('0 8/5 * * *', () => {
    console.log('run the application from 8 am to 11 pm');

});

but when I try to execute this file it gives this error:

throw new Error(`${patterns[2]} is an invalid expression for hour`);

I'm using node-cron. Can someone help me?

Troxscizz
  • 1
  • 1

1 Answers1

0

You can use this to run it everyday at every hour from 08:00 am to 11:00 pm.

0 08-23 * * *

You can check the validation in here.

SaC-SeBaS
  • 174
  • 8