N
N
newaitix2018-06-01 14:52:20
JavaScript
newaitix, 2018-06-01 14:52:20

Schedule cron nodejs?

Help with scheduling

var http=require('http'),
    request=require('request'),
    fs=require('fs'),
    cron=require('cron'),
    cronJob=cron.job("10 0 * * * *",function(){
    });
cronJob.start();

I need to run every 10 seconds
and every day
Every 10 seconds, as I understand it, wakes up like this 10 * * * * *
And every day * * * 0 * * or * * 24 * * *
But 10 seconds do not work, so I did not understand correctly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-06-01
@Sanasol

cron has no seconds.
If you need it in seconds, then run it every minute and in the script itself repeat 6 times with an interval.
The first digit of the crown is minutes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question