Amit Kumar
Amit Kumar

Reputation: 407

node js crone job is not working first day of every month

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

Answers (2)

Nilesh Solanki
Nilesh Solanki

Reputation: 63

You can check the expression config from the below image.

If you write like this " * * * " it will run for every minute.

enter image description here

Upvotes: 1

Manuel Spigolon
Manuel Spigolon

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

Related Questions