Create recurring job to start at specific time and run every 2 hours

I am looking for a code example where one sets the start time for a job to a specific time and set to repeat every 2 hours.

The Cron object you use to specify the delay has overloads to specify the start hour and minute.

I have similar issue where I want to schedule a recurring job that will run daily, but don’t want it to start running until a time in the future. I’ve been googling around and couldn’t find a way of doing it in Hangfire. Does anyone have similar problem?

Hi Muxstang,

You could run a schedule job to start after your specific date and time . Then, in this job add your recurring job using Cron.HourInterval(2).

Thanks

1 Like

In case you haven’t found a solution, you can use a string in the following format to schedule the job:

“50 3 * * *”
Minute Hour Day Month Week

source: https://crontab.guru/