execute a job at every 3 hours of every day -help
See original GitHub issueHi, noob to this cron world I want o execute a job at every 3 hours of every day
var rule = new schedule.RecurrenceRule();
rule.dayOfWeek = [0,6];
rule.hour = 17; // can i add multiple times [06,9,12,15,...]
rule.minute = 0;
var j = schedule.scheduleJob(rule, function(){
console.log('Today is recognized by Rebecca Black!');
});
or which seem too long
var rule1 = new schedule.RecurrenceRule();
rule1.dayOfWeek = [0,6];
rule1.hour = 06; // set at 6 am
rule1.minute = 0;
var rule2 = new schedule.RecurrenceRule();
rule2.dayOfWeek = [0,6];
rule2.hour = 09; // set at 9 am
rule2.minute = 0;
...
var j = schedule.scheduleJob(rule1, function(){
console.log('Today is recognized by Rebecca Black!');
});
var j = schedule.scheduleJob(rule2, function(){
console.log('Today is recognized by Rebecca Black!');
});
..
any help would be appreciated
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Cron job every 3 hours - Crontab.guru
Cron job every 3 hours is a commonly used cron schedule. We created Cronitor because cron itself can't alert you if your jobs...
Read more >Run a scheduled job for every 3 hours - ServiceNow Community
yes if you want to run it every 3 hours, then day should be 0 so that it runs every 3 hours from...
Read more >How to set a cron job to run every 3 hours - Stack Overflow
Is this the correct way for setting a cron job to run every 3 hours? After setting it this way, cron is executing...
Read more >How to set Cron job that run after every three hours for ...
You should be able to use the following line to run a job every 3 ... To check whether your cron job ran,...
Read more >Cron job every 3 hours - Cron Expression To Go
Cron Expression To Go. Cron expression to run a job every 3 hours. "At 0 minutes past the hour, every 3 hours". next...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, Try this:
var j = schedule.scheduleJob('0 0 */3 * *', function(){ console.log('The answer to life, the universe, and everything!'); });
@vcasadei use a
Range
: