Reputation: 365
I have a problem executing a cron job in node/express application using node-cron library. The application is deployed on Google Cloud App Engine.
I want to send automatic emails every day at 9 AM, but the cron only work in the first day and then never sends.
Here is my code :
cron.schedule("0 0 9 * * *", () => {
sendEmails();
},{
scheduled: true,
timezone: "Europe/Paris"
});
Thanks
Upvotes: 0
Views: 495
Reputation: 4961
Here you have 2 issues. A cron expression have only 5 elements not 6.
Also according to your expression your cron will be excecuted on the dat 9 of each month
probably you want something like this
You probably want to verify your cron expression with a tool like https://crontab.guru/
Upvotes: 2