Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scheduling to run a macro on every hour

Tags:

c#

macros

umbraco

Is there anyway to schedule a macro in Umbraco or a .ascx file to run every hour?

thanks

like image 275
user2026013 Avatar asked Mar 14 '13 16:03

user2026013


1 Answers

There are two ways to run scheduled tasks in Umbraco:

  1. Add tasks to umbracoSettings.config. See Scheduled Tasks from the Umbraco Wiki.
  2. Use the TaskScheduler package.

TaskScheduler provides a nice interface to setup tasks in the Umbraco backend. You can schedule tasks to run at specific times and you can set the recurrence. It also can send emails when tasks are executed.

Adding tasks to umbracoSettings.config may be simpler. Below is an example:

<scheduledTasks>
    <!-- add tasks that should be called with an interval (seconds) -->
    <task log="true" alias="test60" interval="60" url="http://localhost/umbraco/test.aspx"/>
</scheduledTasks>
like image 81
Douglas Ludlow Avatar answered Oct 15 '22 11:10

Douglas Ludlow