0
votes

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

1

1 Answers

2
votes

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

enter image description here

probably you want something like this

enter image description here

You probably want to verify your cron expression with a tool like https://crontab.guru/