question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run Cron Job every 59 minutes (1 hour) with Node-Cron

See original GitHub issue

I’m more familiar with cron than with node-cron. I just need to run an task each hour, every day. Is this right?

var CronJob = require('cron').CronJob;
var job = new CronJob('* * 59 * * *', function() {
 // do something

  }, function () {
    /* This function is executed when the job stops */
  },
  true, /* Start the job right now */
  timeZone /* Time zone of this job. */
);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

6reactions
liukuncommented, Apr 5, 2017

Seems should be '00 59 * * * *' to run at 0:59 1:59 2:59 … 23:59

4reactions
RojaPadicommented, Sep 10, 2018

import cron from ‘node-cron’;

cron.schedule(‘*/59 * * * *’, function () { subscriptionStatusExpiry(); });

->subscriptionStatusExpiry() is function name ->this is worked for 59th minute of every hour

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Schedule a Job in Node Using node-cron
It will execute your job at the first, second, and third minutes of each hour. How to Use Step Values to Populate Chrone...
Read more >
How To Use node-cron to Run Scheduled Jobs in Node.js
Use Node.js and the node-cron library to schedule jobs to manage logs, ... server and use node-cron to schedule a task to run...
Read more >
Run Cron Job every 45 minutes with Node-Cron
You're probably looking for 0 */45 * * * *. The ranges are here. Seconds: 0-59; Minutes: 0-59; Hours: 0-23; Day of Month:...
Read more >
Scheduling tasks in Node.js using node-cron - LogRocket Blog
The task below runs five minutes every two hours between 8 a.m. and 5:58 p.m. import * as cron from ...
Read more >
Cron job every 1 hour - Crontab.guru
The quick and simple editor for cron schedule expressions by Cronitor. “At minute 0.” next at 2022-12-20 16:00:00. random. minute. hour.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found