0

I need to run a node-cron schedule once everyday i.e., once every 24hours. Can I do it without specifying time?

var job = new CronJob('0 0 0 * * *', function() {

})
Nandhini
  • 645
  • 7
  • 21

1 Answers1

0

You cant do it without specifying time as cron needs time on which it has to excecute callback function.

You can use "0 0 */1 * *" which will be executed "At 00:00 on every day-of-month"

var job = new CronJob('0 0 */1 * *', function() {
   // here goes things you want to execute 
})
Prem popatia
  • 321
  • 3
  • 14