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
0
votes
1 answer

JavaScript Bind (this) without access to class

I am having trouble accessing a class' methods without some modifications to the class itself. See the following demo code: function myCallback() { this.otherMethod(); } class hiddenClass { static hiddenFunction(callback) { callback(); …
gjones
  • 3
  • 1
0
votes
1 answer

Do I need to keep my script running for node-cron to do scheduled tasks?

I am building a web scraper and I am new to it. What it does is that it scrapes the amazon prices for the URL provided by the user which then sends an email whenever the price goes below the price set by the user. I am using SendGrid to send the…
TanDev
  • 359
  • 3
  • 5
  • 13
0
votes
1 answer

Why is my hour parameter not working in node-cron

I am trying to run a cron job using node-cron every Monday at 8:30 so I use "30 8 * * Mon" which never runs (I also used "30 08 * * Mon" to be sure). After a bit of troubleshooting, I have seen that "30 * * * Mon" does work and runs on the 30th min…
visandres
  • 47
  • 6
0
votes
1 answer

How to set node-cron to run in 12 hours

I wish to schedule a task in my node.JS project to run in 12 hours from the time of schedule. I tried using 0 */12 * * * but it can only run at the 12th hour. How to do please?
0
votes
0 answers

Using node-cron to run a scheduled reminder for my discord bot, ran into some problems

So I was trying to create a scheduled reminder for my discord bot and after a lot of tinkering this is what I got. const Discord = require("discord.js") const cron = require("node-cron"); const bot = new Discord.Client({disableEveryone:…
0
votes
0 answers

How to stop node cron at specific time daily?

I am trying to send push notification to the users and trying to send 3 times or 2 times a day but after that i don't want to send the notification like i have sent 3 notification today and don't want to send notification after that and next cycle…
0
votes
1 answer

Schedule tasks for each client on relative timezone in Android & iOS with NodeJS backend

I have a mobile app (native Android & iOS) which requires client's data to be updated (to renew the recurring items) daily at midnight. I'm using cron-jobs in nodejs using node-cron library and its working perfectly fine as it should. BUT the main…
TalESid
  • 2,304
  • 1
  • 20
  • 41
0
votes
1 answer

Are node-cron and cron modules in npm same?

I'm trying to implement a cron job scheduler in my node api. When i went over search i see there are two modules. node-cron and cron. With reference to the below question, it adds to my confusion, as the user has node-cron installed on his machine…
0
votes
1 answer

I want to schedule a task at specific time with timezone specified with using node-scheduler, How should I do it?

Above is my code, which I want to use it as notification scheduler, but not working const nodeSchedule = require('node-schedule'); var a = new Date(); let rule2 = new nodeSchedule.RecurrenceRule(); rule2.second = a.getSeconds(); …
shiVam_Mak
  • 39
  • 1
  • 8
0
votes
1 answer

How do I automatically cleanup old Twilio Chat Channels on a schedule?

I built a production application that uses Twilio Programmable Chat for one of its features. It occurred to me that the app creates lots and lots of chat channels each day and there is no way to expire them automatically. Twilio limits you to…
0
votes
1 answer

node-cron looping endlessly on vm

Im having a cron job set up on a gcloud compute instance. It runs as expected on my local, but on the gcloud instance it waits until the first run and then starts to execute in an endless loop without a time gap. async function runScript() { …
Nidor
  • 85
  • 1
  • 5
0
votes
1 answer

How does node cron remembers its tasks?

I am trying to understand how node-cron by kelektiv works. Specifically, if your node app crashes, how does it remember the dates that you scheduled for an event? Does it store the jobs in a database somewhere or a somewhere locally on the machine?…
KJ Ang
  • 305
  • 3
  • 9
0
votes
0 answers

Port binding time problem when deploying a Discord.js bot with scheduling using node-cron

I've been trying to create a Discord bot that posts reminders at 9:00 AM and 9:00 PM everyday from March 22, 2020 to April 27, 2020. The scheduling process is where I initially got stuck. I took 2 approaches: 1. Doing it myself, using a 12hr long…
0
votes
0 answers

Using Node-Cron to Run a JS file with Node

I am attempting to set up a task using node-cron and shelljs to run a js file with node. Am I setting this up correctly? const cron = require('node-cron'); const shell = require('shelljs'); cron.schedule('0 0 0 * * *', () => { …
Nick
  • 466
  • 1
  • 6
  • 12
0
votes
2 answers

Node Cron Execute specific function

I'm using node-cron for scheduling in my express backend, here is the example. I set my scheduling configuration in index.js, and I've develop the function that will execute by cron in training.js index.js: const training =…
Blackjack
  • 1,016
  • 1
  • 20
  • 51