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
0
votes
0 answers
How to schedule bi-weekly cron jobs using @nestjs/schedule module
By bi-weekly I mean every two weeks.
I have a job I'd like to run every two weeks on Saturdays at 4:30pm and I'm using NestJs's @Cron decorator to specify when it runs.
Is there a simple way to specify intervals of two weeks from a specific start…

Dozie
- 103
- 11
0
votes
0 answers
Why is node-cron failing to update mysql database?
I am using node-cron to update mysql database every minute, node-cron is working fine (as I checked it by logging some data in the console) but its not updating the database. What am I missing?
const cron = require("node-cron");
const db =…

Aimsat
- 338
- 4
- 10
0
votes
0 answers
Node Cron job to run on 28th and 29th day of every month
I want to run a cron job on every 28th and 29th day of a month. My code is as follows:
cron.schedule('* * 28,29 * *', function() {
let d = Date()
console.log(`*********************** Check Current Month's Data Cron Job - ${d}…

Sujan Shrestha
- 1,020
- 1
- 18
- 32
0
votes
0 answers
Node-Cron: Running multiple schedules a day
Tags:
node-cron, ExpressJs, NodeJs, Replit, Uptimerobot
Situation:
Hey all!
I am trying to get my discord bot to send multiple messages every day on specific times.
I deployed my bot on Replit and use Uptimerobot to ping my app every 10 min to keep…

Basile
- 150
- 11
0
votes
1 answer
Use variables instead of numbers to set node-cron schedule
I am very new to node.js. I would like to schedule a cron job based on user inputs and pass these inputs into the cron expression.
I have written a shared wallet in Solidity and would like the owner to be able to schedule transactions to various…

millbird
- 53
- 1
- 9
0
votes
1 answer
NodeJs: Mongodb query never called in cron job with node-cron
I have created a cron job to update some data in the database, but the query is never executed.
my cron job :
const cron = require('node-cron');
const Document = require('../models/document');
const User = require('../models/user');
…

Singh
- 783
- 1
- 6
- 24
0
votes
2 answers
How to wait until a pdf is generated Javascript
I am using node html-pdf to generate a pdf and nodemailer to automatically send an email containing the pdf every minute using node-cron as demonstrated in the following code:
cron.schedule('* * * * *', () => {
// function to generate scan…

NicLovin
- 317
- 3
- 20
0
votes
1 answer
NodeJS schedule (start/stop) multiple tasks
I have a HTML slider with 4 positions. 15, 30, 45, 60 "minutes". Depending on the position I want to execute some code every selected minutes. So I decides to implement a switch case and use node-cron (or node-schedule) to achieve this.
But I am …

trash
- 13
- 3
0
votes
1 answer
I have a Discord.js bot that is not sending a scheduled message
I have a Discord bot that is scheduled to send a message every 1st of July (and some other stuff). Yet, it's not sending the message, but yet it is sending the other stuff. Thanks in advance.
This is the specific lines where it doesn't send the…

world purple
- 15
- 5
0
votes
1 answer
how can i fix mysql error with cronjob (node-cron)
Am using node-cron to run a cron job every 12 Oclock Midnight, the job am running is to increment some data on the user table,
the issue now is that the job will run twice.
e.g I wanna increment 15, after 12 o'clock, it will turn to 17 instead of…

The Owner
- 1
- 3
0
votes
1 answer
scheduling task in nodejs periodically to send emails to the user
I'm trying to send an email to the user periodically(daily, weekly, monthly) based on their preference from my nodejs application using node-cron. Here, user can edit/change their mail preference(weekly, daily..etc). so when they do, the cron…

ajay
- 328
- 1
- 5
- 17
0
votes
0 answers
Schedule mail based on condition
I need to schedule a mail every 6 hours whenever the user's balance falls below a threshold. I'm trying to use node-cron package but everytime my server restarts, I'm sure it will start rescheduling and I don't want that to happen.

Deep Mandal
- 33
- 1
- 8
0
votes
1 answer
Unable to perform $merge aggregation in cron job in nodejs+mongodb
I tried to create a cron job that gets data from one collection and do some operations using aggregate method and finally dump the output to another collection in same database (using $merge). If I try the code for aggregate in mongo shell, then the…

Balaji
- 47
- 7
0
votes
1 answer
Node Cron start running at 0.00 minutes and then after 60 minutes
i am using node-cron. what i want is when my program start node-cron should run the function and then wait for 60 mints and run the function but in real when i start the execution node-cron did'not run the function on start but after 59 mints .
any…

Haseeb Ahmed
- 19
- 3
0
votes
0 answers
Converting recursive function to node-cron job
I'd like to convert a recursive function with setTimeout to a node-cron job, but am not sure how to return the parameters:
async function Infinite(page, initData, updateData = new Map()) {
// Check for updates
// If found add to updateData
//…

newaza
- 13
- 3