As a new Umbraco user, one of the first things I needed to set up on my new site was a scheduled job. According to the documentation you do so by specifying a url to the task in umbracoSettings.config. But there is an alternative if you dont like to trigger them by url’s.

The reason I started looking for alternatives, is because my site uses Windows autentication. It seems the builtin scheduler for timed publishes fails in this environment due to how the authentication headers are passed to the api’s. But that is another matter.

I started to look at the Umbraco code for how the scheduled publishing is implemented, and found the Umbraco.Web.Scheduling namespace. You can browse the source here.

It seems the ScheduledPublishing class is derived from a base class called RecurringTaskBase. RecurringTaskBase has the following description:

“Provides a base class for recurring background tasks.”

Now that sounds promising, so let us try to build a new scheduled task mimicking the behaviour of ScheduledPublishing.