Schedule a task

Create the task

To create a scheduled task, perform the following:

  1. Create an instance of your scheduled task class.
  2. Set the execution time and other custom properties, if required.
    You can set the execution time in one of the following ways:
    • Use the ExecutionTime property.
      You sets the exact execution date.
    • Use the ScheduleSpec property.
      You describe the scheduled specification using the cron syntax.
      When using this approach, you need to set the ScheduleSpecType to "crontab".
  3. To schedule the task, use the SchedulingManager.
EXAMPLE: The following example demonstrates the use of cron syntax. For more information, see Generate crontab expressions.

Start a scheduled task manually

You can also execute the scheduled task once using SchedulingManager.RescheduleNextRun() in your Sitefinity CMS widgets or event handlers:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?