Questions tagged [node-cron]

The node-cron module is tiny task scheduler in pure JavaScript for node.js based on GNU crontab. This module allows you to schedule task in node.js using full crontab syntax.

198 questions
2
votes
0 answers

Should I run node-cron as part of the nodejs api server or as another node server

I have the following node api server to which I've added a node-cron job to periodically send emails to some users once per day. The code is working, however, I was wondering if I'll get myself into some performance issues. Would it be better to…
Bogdan Daniel
  • 2,689
  • 11
  • 43
  • 76
2
votes
1 answer

How to check how much time node-cron is taking for executing cron-job

I want to check how much time cron job is taking to execute the cron job process for that particular cron job. After which if cron-job is taking more than 10 minutes to execute that process then that particular cron-job should be stopped and rest…
2
votes
1 answer

Reminder for recuring calendar events with mongodb

I want to send notifications/reminders to my users, the reminder schema is basically like this { user: 'number', time: { //this is the time the event will occur type: Date, index: true }, reminder: Number, //the…
Matheus Hatje
  • 987
  • 1
  • 7
  • 18
2
votes
1 answer

destroy a node-cron job or cancel a node-scheduler job

I am developing a nodejs application that schedules multiple cron jobs. By the way I got an error when I try to cancel jobs. The situation is like below. I created multiple cron jobs using node-cron or node-schedule. A few jobs's start time…
vcvcvcvc
  • 137
  • 4
  • 10
2
votes
1 answer

Cron job not working in firebase functions

I have the following cron job that I need to execute everyday at 6 and 9AM. cron.schedule('00 00 6,9 * * 0-6', function() { alertAllMembersWithAppointments();//executed everyday at 6 and 9AM}); When I set the timing like this cron.schedule('* * *…
MbaiMburu
  • 875
  • 1
  • 10
  • 19
2
votes
1 answer

Node mail scheduler sending multiple mail behind multiple server instance hosted on cloud

I have a Node.js app running in multiple instances on google Cloud. The app has - among others - a scheduler ("node-cron": "^1.3.0") which sends a reminder mail to customers once every day. Now with multiple instances of the app, I get multiple…
2
votes
1 answer

Node-cron if node app restarts

So here is a thing, I have some lawyer app, and he needs to set reminder for some case, that reminder could be tomorrow, next week, next month idk. I was thinking about using node-cron, thing is i dont know what will happen when my app restarts, I…
Mario Rozic
  • 254
  • 5
  • 12
2
votes
2 answers

How to schedule a functions to run everyday with NodeJS and Generators?

I need a function to be called every day at a given hour with generators (yields), doing my search I've found out two node modules that enable me to do this, one is node-schedule and the other one is node-cron Node-cron does not seems to support…
Azephiar
  • 501
  • 6
  • 19
2
votes
3 answers

How can we run the node-cron job in every 12 hours interval?

I want to schedule the email after every 12 hrs , For that I have used node-cron. I have used the following code but its not giving me actual result, so please help me to resolve this issue, var job = new CronJob('0 0 */12 * * *', function(){ …
Santosh Shinde
  • 6,045
  • 7
  • 44
  • 68
2
votes
1 answer

Node-cron on windows server

I have used node-cron to schedule job in my node application and I work on ubuntu OS. Below is the code for same. I am running the scheduler every one hour and it works fine on my local machine. new CronJob('0 0 * * * *', function() { …
XCEPTION
  • 1,671
  • 1
  • 18
  • 38
2
votes
0 answers

node-cron: Cron tick firing every second

I'm using node-cron to attempt to run a function at a specific time. The function should fire at 10:00 on a weekday. import { CronJob } from 'cron' new CronJob('00 00 10 * * 1-5', function() { console.log('Fired'); }) When I run this code the…
love2node
  • 347
  • 1
  • 3
  • 14
2
votes
0 answers

is node-cron job intervals inclusive of both?

I want to run 2 cron jobs. 0-7 at 1 hour interval (i.e. 0,1,2,3,4,5,6,7) 7-0 at 15 min difference (7:00 should not be included here as it is include in earlier interval and 00:00 shouldn't be here also since it is included earlier) Now, what I have…
atulj
  • 71
  • 2
  • 4
  • 10
1
vote
2 answers

Need to run cron job after every 3 hours

I need to run cron job every 3 hours after the start of job. Currently I am using 0 */3 * * * If I start job now according to my time at 2:45 PM this command will complete its first interval at 3:00 PM and next interval at 6 PM. I want to complete…
1
vote
2 answers

How to schedule a job between specific time?

I'm trying to schedule a job which runs for every 10 seconds between 9:00 AM to 3:30 PM from Monday to Friday using node-cron but I cannout achieve it. Here's my Node Cron code right now I can able to schedule between 9:00 AM to 4:00 PM but I want…
Arunprasath
  • 57
  • 1
  • 7
1
vote
0 answers

How to run a corn job from 9:30am to 4pm for every half an hour

I want a expression for cron job which is going to run every half hour starting at 9:30am to 4:00pm from monday to friday. cron.schedule('30,*/30 9-15 * * 1-5', async() => { function() }); my Cron job is running every half an hour between 9:30 to…
1 2
3
13 14