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.
Questions tagged [node-cron]
198 questions
1
vote
1 answer
Cron job with node-cron will not console.log for a test
I am trying to run a test cron job in my node.js app (one just for this job) but it is not console.log() like it should be. It should console.log() every 10 seconds but it won't.
This is my only file in my directory/app other than package.json file…

Kirbytech
- 634
- 1
- 5
- 18
1
vote
1 answer
MEAN app set cron job with node-cron on app load with API call
I'm looking for a way to check the subscriptions of our users with a cron job daily. I want to use node-cron for this. I'm not sure where I should put the code to start the cronjob. Currently, I have it set up like this:
app.js:…

Thomas L
- 320
- 3
- 14
1
vote
1 answer
Writing a reschedulable cron job in Node.js
I am using node-schedule node package to write the cron job. I am able to write a simple schedular but what I want is a reschedulable job.
In my app, users can start a task for a specific date. Now I can acheive this easily by below code.
var…

Saurabh Palatkar
- 3,242
- 9
- 48
- 107
1
vote
1 answer
Update multiple documents with mongoose using node-cron
I'm trying to update multiple document with mongoose using node-cron. What I'm trying to accomplish is all documents that was created, let's say, July 1, will have an status of inactive after 30 days.
I manage to update multiple document using the…

Sherwin Ablaña Dapito
- 928
- 1
- 15
- 33
1
vote
1 answer
Scheduling an email report that runs based on user selected date and time
I came across these two libraries https://www.npmjs.com/package/node-schedule and https://www.npmjs.com/package/node-cron.
The user can disable/enable email reports for a scheduled task.The scheduled report can be monthly/weekly/daily.
I save the…

LoneRanger
- 665
- 13
- 31
1
vote
1 answer
Using cron with redlock and cluster in nodejs
I want to run a task every minute and for this I chose cron. Now I am running node using cluster module and it's spawning 4 processes but I want to run cron on only once per process per minute.
Now one solution to this is to run it in master. But…

Abhyudit Jain
- 3,640
- 2
- 24
- 32
1
vote
1 answer
Single cron job run on several timezones node-cron
I have configured jobs with node-cron and yeah I love this node module to schedule job in node.
Here I have requirement of sending push notification to users which are located in different timezone.I want to send notification to them on specific…

Satyam Koyani
- 4,236
- 2
- 22
- 48
0
votes
0 answers
How to design a database and make a function to get the most active users by day, week... based on activity scoring criteria for each time period
I use node js technology, write backend in express js and database in mongoose
I'm having a "User" Model as follows:
{_id: ObjectId,
name: string,
score: number,
timeStamp: Date}
For example, if a user answers a question, I will find and update…

Mai Đức Thắng
- 13
- 4
0
votes
0 answers
PM2: Node.js App with Cron Jobs on Droplet - Reloading Server and Duplicate Cron Runs
I have a Node.js application running on node v16.15.0 within a Digital Ocean droplet. The app employs cron jobs using the node-cron v3.0.1 package to handle significant processes.
Problem:
Whenever I deploy new code, I find it necessary to reload…

Keval Rakholiya
- 9
- 4
0
votes
0 answers
How to run cron job locally in loopBack framework?
I have two questions.
1.How to run cron job locally in loopback framework?
2.How to inject a class in a service file and then use the class's method?
For example I have code like
import {CronController} from "../CronController" ;
import cron from…

Naveen Kumar
- 31
- 3
0
votes
0 answers
Boardcast message with socketio periodically
I'm wanting to build an application where information will be sent one-way over SocketIO periodically once a minute. For example, the message "It is now 15:05:00".
My idea is to put the io.emit fragment in setInterval or use node-cron. However it…
0
votes
0 answers
Is a good idea to use node-cron for update columns in my SQL database once a day?
I need to update columns in my SQL database once a day automatically.
My backend logic works with deadlines (deadlineTime which is the due date and deadline which is the status of the deadline, "on time" and "out of time" for example).
For example…

Pato
- 3
- 2
0
votes
0 answers
Cron.Schedule no longer functioning after 6 months of smooth operation
Running on Mac OS 10.12.6
I have a simple bot that logs me into a website daily. It's been functioning well with the following code for months until suddenly cron.schedule has stopped working. I can't seem to figure out what has changed or how to…
0
votes
0 answers
cron.schedule() running multiple times:
I have this function which is used to check every second if the current time matches the time of a scheduled email using cron.schedule. However, when it reaches the right time the sendEmail function runs 20+ times as well as the sql query all within…

CodingRookie
- 11
- 2
0
votes
0 answers
Sails.js and node-cron (trying to make the scheduler work on my birthday reminder app)
I'Ve been having troubles scheduling reminder on my birthday reminder app. I tried using cron, got it running semi-way and it im still getting errors. I need some help.
this is the error on my terminal: okay I think I may have gotten cron to start…

Barbs
- 1