Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node cron every second

This worked for me -

    cron.schedule("*/10 * * * * *", function() {
      console.log("running a task every 10 second");
    });
Hope this helps someone.

Reference - https://support.acquia.com/hc/en-us/articles/360004224494-Cron-time-string-format
Comment

node cron every 10 minutes

var cron = require('node-cron');

cron.schedule("0 */10 * * * *", async () => { //every 10 minutes
    console.log("running a task every 10 minutes");
});
Comment

Node -Cron Run every minute

var cron = require('node-cron');

var task = cron.schedule('* * * * *', () =>  {
  console.log('will execute every minute until stopped');
});

task.stop();
Comment

PREVIOUS NEXT
Code Example
Javascript :: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 
Javascript :: Extract the domain name from a URL 
Javascript :: Get the index of an Object in an Array in JavaScript 
Javascript :: javascript hello 
Javascript :: comment out in javascript 
Javascript :: convert date dd/mm/yyyy to date object js 
Javascript :: javascript sort array descending order 
Javascript :: check if a word exists in dictionary javascript 
Javascript :: change array of object to object without index value 
Javascript :: use font awesome in react native 
Javascript :: javascript filter array multiple conditions 
Javascript :: import js file 
Javascript :: resize array javascript 
Javascript :: how to write a json in r 
Javascript :: regex street 
Javascript :: react native passing params to nested navigators 
Javascript :: filter object js 
Javascript :: javascript function uppercase to lowercase 
Javascript :: javascript alert 
Javascript :: combine 2 arrays javascript 
Javascript :: .scrollLeft + 1, 0 
Javascript :: javascript particles js not working 
Javascript :: insert element after element javascript 
Javascript :: javascript check if array 
Javascript :: import syntax node 
Javascript :: how to auto refresh page in javascript 
Javascript :: short if statements in javascript 
Javascript :: how to apply limit in filter javascript 
Javascript :: js alert new line 
Javascript :: javascript hello world program 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =