Sitecore Scheduler: Part-1

In one of my projects, the client requirement was, to migrate data from an external Database to Sitecore Database and the import task should run automatically with a specific time interval on a scheduled day.

In this blog I will discuss with you about Sitecore Scheduler in three sections:

  1. Sitecore Scheduler
  2. Create Scheduler in Sitecore
  3. Pass Sitecore items as a parameter in Scheduler

As the name suggested, the scheduler is a task that gets executed with a defined interval in terms of the day, date, or can be a specific time in the day.

There are three ways in Sitecore to schedule task in Sitecore CMS:

  1. Configure agent in web.config:
    It’s a very common and easy approach to create a scheduler in Sitecore. Using this approach, you have to restart the ASP.NET worker process as it requires changing into the web.config file.

  2. Create Window Task Scheduler or Window Service to call web service in Sitecore:
    In this approach, you can write a Window Service, or a Console application trigger it with the Window task scheduler. It will execute the task defined by you.

  3. Create scheduler in Sitecore database:
    In this approach, you need to specify command and scheduler in the Sitecore database under “/sitecore/system/Tasks”. It's a user-friendly option and you can configure the scheduling option from Sitecore and execute code of the .Net class with the help of the command option. This approach does not require any change to web.cofig file so you don’t need to restart the ASP.NET worker process.



Note: I would suggest you run the scheduler task on Content Management instead of Content Delivery. So that you would not put unnecessary load on CD Server.

In continuation of this Scheduler series blog in my next blog, I will discuss with you “How to Create and Configure Scheduler in Sitecore”.

Happy Sitecoreing ðŸ˜Š

Comments

Post a Comment

Popular posts from this blog

Sitecore Installation Error: Failed to Start Service 'Sitecore Marketing Automation Engine'

Import CSV Data in Sitecore Using PowerShell: Part-3

Sitecore : The database principal owns a schema in the database, and cannot be dropped message