10

I have my app in node js and i want them to be executed on its scheduled time
But the problem is in between that if my server crash/stop/restart then those scheduled jobs are not persisted and are not executed.
Also, all my jobs are scheduled and executed using only single process, but i want multiple process to do the job.
I want all my jobs to be persisted and executed even if my node server restarted or better its get executed even if my server is not running.

Agenda - using mongoDB, which i don't want to use.
Node-scheduler - not able to persist cron jobs

    var ctab = require('crontab');
    ctab.load(function(err, crontab) {
      var job = crontab.create('* * * * * *');
      var jobs = crontab.jobs();
      crontab.save(function(err, crontab) {
    });
});

  • If you don't add some code and more information, we won't be able to help you. – acostela Apr 12 '16 at 09:00
  • I'am searching for a node package which can persist cron jobs and can be executed even if my system restarted what happens now is all scheduled jobs are gone once i restart my server. – Shubham Tripathi Apr 12 '16 at 09:31
  • @ShubhamTripathi, why can't you use Agenda ? did you try that ? I also need something like this, i think agenda should be the right choice. – Daga Arihant Mar 27 '17 at 10:48
  • Daga - will agenda work in case my server got restarted as node is a single threaded and what happen if my server stops at the time of job execution, will that job executed even if my server is not running – Shubham Tripathi Mar 28 '17 at 11:49

1 Answers1

7

There is a few node packages to management and persist scheduled jobs:

J.C. Gras
  • 4,934
  • 1
  • 37
  • 44