Node cron, run every midnight

前端 未结 5 1724
粉色の甜心
粉色の甜心 2020-12-17 11:03

I want to run cron job daily at midnight. For this I am using

0 0 0 1-31 * * 

but it doesn\'t work for me. I am using the node cron. Plea

5条回答
  •  再見小時候
    2020-12-17 11:12

    It's quite simple....

    The below is the code to run crone job every day 12 AM..

    var job = new CronJob('0 0 0 * * *', function() {
     //will run every day at 12:00 AM
    })
    

    For more https://www.npmjs.com/package/cron

提交回复
热议问题