node-cron icon indicating copy to clipboard operation
node-cron copied to clipboard

day of the week. one week a month(syntax question)

Open pvcon13 opened this issue 4 years ago • 2 comments

Thank you for this framework :) Does this syntax work (seem to getting a parsing error)

45 23 ? 3,6,9,12 6#3

Meaning at 11: 45 ( I set the time zone) on a quarterly basis on Saturday night where its the third Saturday on that month.

Basically I have a dev and a staging and a production system in the cloud and I want quarterly updates to run all Sunday early morning with each of the three clouds being updated a different week.

Would be fine if I could just fires to be the first Sunday of the month and use different months.

Do you support the # syntax? The routine is loading 10 plus hours of materials from a remote site and the db is really not fully online during that update.

If I have the syntax wrong please LMK. Alternatively suggestions are welcome. thanks again for this, its a god send.

ps Alternatively: I notice you can pass in a date ( I assume with a timezone), but does that support an array of dates (like four days a year as I described above? If so that would work as well

pvcon13 avatar May 03 '20 15:05 pvcon13

Hi. This syntax isn't currently supported, nor is a n array of dates. I've been working towards supported expanded Cron syntax but am super busy with other things so little time to dedicate to it. I would definitely review a PR for it if someone can get to it before me.

The array bit is a little tricky, but I could try to think about how that might work. Might be faster to implement. Also, if entertain a PR for this as well.

ncb000gt avatar May 03 '20 16:05 ncb000gt

It would be great to support nth Suday of a month with #n notation. Also I failed to use 7 as Sunday you support only 0 as Sunday meanwhile https://crontab.guru/ supports 0 and 7 as Sunday.

t0lik avatar Aug 25 '21 12:08 t0lik