Hangfire daily execution schedule - hangfire

By default the daily schedule always starts the interval from the start of the month.
But I don’t want this behavior.
Rather, I want a job to start on the date I set and consider the interval from that date onwards and not from the start of the month.
Is there any way to achieve this?

Related

Reoccurring SQL job to run on the 2nd and 4th Thursday of every month

I need a job to run on the 2nd and 4th Thursday of every month. I know I can set up a job to run every two weeks but that logic doesn't work when a month eventually hits a five week span. Is it possible to set this up using the SQL Server Agent Schedule? If not, does anyone recommend another method?
Create two schedules on the job, one that runs on the second Thursday, and one that runs on the fourth.
Under the Frequency heading on the Scheduler, change the Occurs drop down to Monthly to get to the options you need.

Running APScheduler job the day before the 1st and 3rd Monday each month

I have an APScheduler job that creates a report our client has requested for the first and third Mondays of the month.
To deliver that in time, I want to run the job the day before the first and third Monday, which can't be specified directly in APScheduler.
I noticed another user had this question as well, describing the request as impossible, in the comments of Running APScheduler Job Every nth Day of Month
Here's how I solved it:
scheduler.add_job(func, 'cron', 'day_of_week'='sun', 'day'='last,1-6,14-20')
By specifying the day of the week, and then specifying the days in the month that could apply, it will fire the day before the first and third Mondays. It only fires when all the conditions are met, so the other dates (which won't be Sunday) don't fire.

Hangfire - How does it handle last couple of days of the month?

I have a UI where users select on which day of each month they want to receive an email. What happens if they select the 31st? How does Hangfire handle the days which have only 30 day or february?
Thank you!
In case anyone comes back to this - this limitation was lifted in Hangfire 1.7 when they migrated to Chronos for recurring CRON expression support.
According to this issue, Hangfire lacks the capability to schedule any job for the last day of the month.
Hangfire use NCrontab, that's not support for # or L
Your best bet (at the moment) is to:
Schedule multiple jobs manually (using calendar to figure out last day of the month or other methods to figure out days in a month)
Not use Hangfire (use something that is more capable in terms of cron type scheduling)
FluentScheduler does have support for LastDayOfTheMonth
Schedule(() => Console.WriteLine("This task will run at last day of every month."))
.ToRunEvery(1)
.Months()
.OnTheLastDay();

Scheduling job in sql server mgmt studio to run for 'x' days in a month

How do I run a job in Sql Server Agent in (SQL Server Management Studio) for 'x' number of days in a month?
eg: Every 1st.2nd and 3rd of every month
The problem is I am not sure of these days! The user will specify the 'x' number of days!
For instance, the user feels for the month of April he wants the job to be scheduled on 'x' days. Here x= 1st,2nd and 4th of April.
And for the month May he feels to schedule on 'x' days. Here x= 7th,8th and 10th!
Is it possible to schedule in such a way?
Is there any script to schedule this???
Make a schedule that's run on those three days. Assign this job to that schedule.
(To elaborate and make it perfectly clear).
Make three schedules (Rightclick Jobs, Manage Schedules).In new schedules choose - Recurring on monthly. One starts the 1st, one starts the 2nd, one starts the 3rd of every month (for example, or x times for whatever day of month you wish).
Name these schedules something that's easy for you to spot in a list.
On the job you wish to run on these days, properties on it, schedule, then pick the schedule(s) you want to assign to the given job.
That should be all.
If the schedule is user defined then I'd probably just schedule the job to run every day and have the first step be to check whether it should be running today and if not exit.
Check Howto Schedule a Job and follow the Instructions of cairnz.

Autosys monthly job schedule

I know how to run autosys job on certain day in a week but how can i run once in a month.. like if i have to run job1 on 2nd day of the month .. any help would be good for me.. thank you
You can specify a day of the month with an extended calendar with the condition MNTHD#nn, where nn is the nnth day of the month.
The extended calendar can be defined like
extended_calendar: second_of_month
condition: MNTHD#2
and you can include the calendar as the run_calendar attribute of your job like
insert_job: job1
run_calendar: second_of_month
Find more information here on the different conditions for an extended calendar.
Use a run calendar. Create a calendar with the days you want the job to run on and add that calendar to the job. The current version of Autosys, R11 allows you to use logic to create calendars. For example the first business day of the month.