Reputation: 407
cron.schedule('* * * 1 *', function () {//do something })
this is my code for cron job, it supposed to trigger the first day of every month. but it won't be doing anything what I am doing wrong here.
Upvotes: 0
Views: 377
Reputation: 63
You can check the expression config from the below image.
If you write like this " * * * " it will run for every minute.
Upvotes: 1
Reputation: 12870
That cron runs
At every minute in January.
https://crontab.guru/#*_*_*_1_*
You should use 0 * 1 * *
At minute 0 on day-of-month 1
Upvotes: 1