Multiple Cron Jobs
See original GitHub issueI’ve noticed other issues regarding this, but multiple scheduled jobs do not seem to work in all cases (LTS Node v4.xx). Example can be seen below…I understand there could be a buried issue but the code within these jobs is not complex (one checks mongo and sends email on condition, one cleans temp folder).
new CronJob('* 1 * * * *', function() {
// Stuff here
}, null, true, 'America/Chicago');
new CronJob('* 5 * * * *', function() {
// More stuff here
}, null, true, 'America/Chicago');
The debug statements placed in these functions do not fire. The first one was working fine, when I added a second neither seem to fire.
Thanks, G
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Multiple Cron jobs in one crontab file - Stack Overflow
I wanted to implement two cronjobs with different execution time. One cron job is for sending emails and second cron job for validating...
Read more >How to Run Multiple Commands in the Same Cron Job
You can use two options to set multiple commands in the same cron job. 1. Use the &&: the double ampersand specifies that...
Read more >How do I setup two cron jobs to run every night at 3:00 and 3 ...
Open a terminal ( Ctrl + Alt + T ) then run: crontab -e. If it asks you to select an editor, choose...
Read more >Cron Jobs: A Comprehensive Guide - SitePoint
This guide covers the basics of cron jobs, as well as some more advanced features. ... Multiple Commands in the Same Cron Job....
Read more >How to Run Multiple Commands in One Cron Job - TecAdmin
It allows us to schedule multiple cron jobs to run at once. We can schedule any shell command or script to can be...
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
just ran this code, and it worked completely fine for me:
note that the second number is the “hour”, since you’re only providing five numbers to the cron string
This could be more explicit in the documentation