Sakthivel
Sakthivel

Reputation: 159

Setup agenda jobs every monday

I want to run a job on every Monday once.

I tried

agenda.every('* * * * * 1', 'Weekly keyworker report');

But it executes a every seconds.I am confused to use that. I am working based on this package.

Upvotes: 0

Views: 624

Answers (1)

TGrif
TGrif

Reputation: 5931

Unlike UNIX cron, node-cron supports seconds and has six fields instead of five.

* * * * * 1 means every seconds on Monday.

You have to change it to something like this:
00 30 10 * * 1 which means every Monday at 10h30.

Upvotes: 2

Related Questions