HangFire recurring job for more than 31 days or more than 12 months do not work - cron

We are using HangFire application to schedule reports and sometimes report can be run for every 40 days or every 20 months but CRON expression in HangFire does not have any support as day of month can be in range of 1-31 and months can be in the range of 1-12
Any idea how this can be achieved.?

Related

Cron periodicity works unclear with month days

I have expression 0 0 6/2 * *
it will run anything every second day starting from 6 day of month and in next month it can be earlier than 6 day? Example cron runs:
2022-06-06
2022-06-08
2022-06-10
...
2022-06-26
2022-06-28
2022-06-30
2022-07-02
2022-07-04
2022-07-06
2022-07-08
...
Does it work like this or cron run only from 6 day every month?
From here
At 12:00 AM, every 2 days, starting on day 6 of the month
So no, it will start on 6th day of month and then every 2 days

How to schedule a Cron job for multiple days every month?

I wish to schedule a airflow job for specific set of dates every month, for example 11th and last day of every month and used the below scheduler expression
25 14 11,L * * # At 2:45 pm on 11th and last day of every month
When I validated the above in https://crontab.guru/ and http://cron.schlitt.info/ i was told the expression as invalid.
Is it possible to schedule together for a known and a unknown (here last) day of every month? If not is there any other way to achieve this?
maybe your cron does not support the "L" flag. you can refer to this CRON job to run on the last day of the month

Cron job for every weekday at 6 am

I was wondering if anyone knew how to create a cron job that runs from monday to friday at 6am.
I am using gitlab CI, quickly looked at the example syntax and am not exactly sure how to limit it to occur from monday to friday.
Not sure what about gitlab CI, but cron syntax is minute, hour, day of month, month, day of week, meaning job which should run every week day from 6am is
0 6 * * 1-5

cron expressions for 2 hours ranges like 12:00AM - 6AM and 8PM - 11:59PM every day

Can I define a cron job to run in 2 time ranges during the day? For example Every day between 12:00AM and 6:00AM AND between 8:00PM and 11:59PM.
Thanks

Is it possible to express 2 week periods as a CRON expression as implemented by Quartz?

Starting from the Jan 1st 2014 the 2 week periods yield the following schedule:
Jan 14
Jan 28
Feb 11
Feb 25
Mar 11
Mar 25
Apr 8
Apr 22
May 6
May 20
etc ...
This is not an idle question. Some companies have exactly 2 week long pay periods, meaning they have 26 pay periods per year rather than 24 for a company that pays twice a month as opposed to every two weeks exactly. I want to know whether I can express the pay schedule of such a company using a CRON expression.
Finally, it is possible that no CRON expression can be used to express what I want, but the Quartz scheduler may have some tricky solution that can ultimately produce the needed schedule. Note, that I can always create a calendar scheduler with 26 explicit triggers - one per pay period. I am not talking about this kind of solution.
I am using the .NET port of the Quartz library.
EDIT
An equally good schedule would be exactly every other Sunday. Note, it is not equivalent to every 2nd and 4th Sunday. Indeed, if a month has 5 Sundays, then the first schedule may result in three instances for that particular month, if started from the first Sunday. Whereas the second schedule always yields exactly two instances per month.
I have a feeling such schedules cannot be expressed in CRON, because they carry over from month to month, whereas CRON resets its month trigger each time a new month starts.
EDIT2
I guess what I am looking for could be expressed by an imaginary DayOfYear CRON field. Helas, no such thing exists. But then again, I could be wrong.
If you're using version 2.0 then you can use the CalendarIntervalTrigger, set the RepeatIntervalUnit to weeks and the RepeatInteval to 2 so that it fires every 2 weeks.

Resources