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 can i export the return value of a function which is scheduled using node-cron package and use it across other files?
I have a function myFunction() which i want to execute once every day. I have used the package cron for the schedule part. Is there a way to module.export the return value of the function so that i can use it in other files.
// scheduler.js
const {…

User_16647160
- 1
- 3
0
votes
2 answers
how can i schedule task from node-cron in vuejs
this is how to use it according to the docs in node js each * has what it does
cron.schedule('* * * * *', () => {
console.log('running a task every minute');
});
# ┌────────────── second (optional)
# │ ┌──────────── minute
# │ │ ┌──────────…

xander
- 395
- 1
- 10
0
votes
1 answer
how use the Cron Syntax for node-cron
I'm trying to execute once a cron job in nodejs with express, with the follow code:
const cron = require("node-cron");
const EventEmitter = require("events");
const event = new EventEmitter();
...
let task: any = {};
const taskName =…

andres martinez
- 994
- 2
- 10
- 21
0
votes
1 answer
node-cron not executing on render server
i am trying to execute multiple functions at different time everyday in my node js
const cron1=cron.schedule(`30 5 * * *`,()=>{
balanceCall(address,symbol,btc,options)
})
const cron2=cron.schedule(`30 2 * * *`,()=>{
…

hrishikesh deoghare
- 33
- 6
0
votes
0 answers
Unable to use node-cron to schedule a task in javascript
So I have built a website on which I'm trying to run a script to schedule a task to run at 12am every night. Since I can't use require(), due to the fact that I am running a web server, I am using browserify to use the node-cron tasks.
I have…

Gu5t4v
- 15
- 6
0
votes
0 answers
Why using variable does not work in node-cron in node-js?
I am trying to use variables "hrs", "min", "sec" to perform a cron job but it does not seem to work correctly.
const express = require('express');
const router = express.Router();
var cron =…

Akshit Tomar
- 1
- 2
0
votes
1 answer
How to bypass clustering
I have an express server and i trying to schedule a job to send automatic emails at a particular time(10:00 am in my case). And i am using node-cron package to schedule jobs.
But i am making use of clustering technique to increase my app performance…

Roshan Shetty
- 267
- 1
- 13
0
votes
0 answers
node-cron stop in the night
I created a cron job with node cron, for now the job is really simple:
module.exports.start = async ( args ) => {
console.log("start cron");
// every 5 minutes
CronJob.schedule('*/5 * * * *', () => {
chatLog.send("A text log sent with…

red
- 1,529
- 1
- 12
- 33
0
votes
0 answers
How to create a cron job that start and end at a specific date in nodejs
I want to use cron job to run a task for example every 3 days at 7pm BUT start in the future and for a specific period of time. (for example from 14/02/2023 to 22/05/2023).
The only thing i could do is running a task every 3 days at 7:00pm.
const…

Morsi.Hamza
- 13
- 3
0
votes
0 answers
Setting an hourly, daily, weekly or monthly email with mailgun, nodejs and nodecron
I have 3 main files of my project which link together - index.html, server.js and mail.js
A portion of mail.js is below
const sendMail = (message, cb) => {
var dict = {
'hourly': '* * 0-23 * * ',
'daily': ' * * 1-31 * ',
…
0
votes
1 answer
Cron job with child_process not ending child_process of previous run
I have this code:
let { exec } = require("child_process");
const job = new cron.schedule("*/2 * * * *", function () {
console.log("Cron job Twitter API started");
exec(
"node /home/user/Raid/src/sub2/index.js",
…

JustinL
- 114
- 9
0
votes
0 answers
Right way to kill a python process (python-shell - NodeJS)?
I have a synchronization project, which invokes a python file to execute loads, so I initialize the application with nodejs.
There is a node-cron that does the event every 1min, and I would like to know what is the best strategy to not jam or leave…

Christian Guimarães
- 105
- 10
0
votes
1 answer
Send a PUT request from all accounts in the database after every 24hours in Production
I have deployed my website, in my website user have to complete 10 orders every day, i want to reset orders at 9am everyday. i am using MERN stack. how to reset orders ? i am thinking of sending put requests that modifies user orders to 0 at 9am…

Furqan
- 81
- 6
0
votes
0 answers
Extracting Date from Node-Cron or node scheduler
Scenario: let's suppose I am a social worker, and I want to organize events at specific at 1st dates of every month and at a particular time throughout the whole year,
Now node Cron can Solve this issue of generating the event recursively at a…

Abdullah moiz
- 112
- 1
- 8
0
votes
1 answer
node-cron only working with an active session
I have a simple node-cron schedule that calls a function:
cron.schedule('00 00 00 * * *', () => {
console.log('update movies', new Date().toISOString());
updateMovies();
});
When I log in to my server using PuTTy or use the droplet console in…

Peter Boomsma
- 8,851
- 16
- 93
- 185