Xml Files
The Xml files are stored under the Jobs folder in the main Simple Scheduler directory. The files must be in a sub-folder. The sub-folder itself is referred to as the group in the interface and the file name is the name of the job.

SimpleScheduler\Server\
SimpleScheduler\Server\Jobs\
SimpleScheduler\Server\Jobs\GroupName\
SimpleScheduler\Server\Jobs\GroupName\Job.xml

Sample
<?xml version="1.0" encoding="UTF-8"?>
<Job Type="SimpleScheduler.Job.MultiTaskJob, SimpleScheduler.Core">
  <Description></Description>
  <Enabled>true</Enabled>
  <Tasks>
    <Task Name="Count to 20" Type="SimpleScheduler.Job.CommandLineJob, SimpleScheduler.Core">
      <Properties>
        <Property Name="Command">..\..\..\CountTo10\bin\Debug\CountTo10.exe</Property>
        <Property Name="Arguments">0 20</Property>
        <Property Name="Hidden">true</Property>
        <Property Name="Timeout">1</Property>
      </Properties>
    </Task>
  </Tasks>
  <Triggers>
    <Trigger Type="Simple">
      <Name>Trigger1</Name>
      <RepeatInterval>10</RepeatInterval>
    </Trigger>
  </Triggers>
</Job>


Tasks
Each job can have more than 1 task as you can see from the <Tasks> collection in the xml.
    <Task Name="Count to 20" Type="SimpleScheduler.Job.CommandLineJob, SimpleScheduler.Core">
      <Properties>
        <Property Name="Command">..\..\..\CountTo10\bin\Debug\CountTo10.exe</Property>
        <Property Name="Arguments">0 20</Property>
        <Property Name="Hidden">true</Property>
        <Property Name="Timeout">1</Property>
      </Properties>
    </Task>


* Name: The name of the task to execute
* Type: The type of task to execute. Currently the only supported type is CommandLineJob
* Properties: A collection of named properties that the task needs. Each command's requirements will be different.

Command Line Job
The properties for the command line job are as follows.

* Command: The full path to the executable that you are looking to execute.
* Arguments: Any arguments that you want to also pass along with the command line.
* WorkingDirectory: The working directory to use while executing the command.
* Timeout: How long the command should execute. This is specified in minutes. If it goes beyond this number the task will be killed.
* Hidden: Whether or not to hide the window. By the default a window is not going to show up either way. But if this is true it will capture the output from the command.

Triggers
Each job can have 1 or more triggers. There are two basic types of triggers: Simple and Cron.

Simple Trigger
The simple trigger is for intervals. When you schedule a job using the simple type it will execute immediately upon creating or modifying the job and then it will schedule out the next interval.
    <Trigger Type="Simple">
      <Name>Trigger1</Name>
      <RepeatInterval>10</RepeatInterval>
    </Trigger>

You just need a Name and a RepeatInterval.

* Name: The name of the trigger.
* RepeatInterval: The interval in which to repeat this trigger. It is specified in seconds.

Cron Trigger
The cron trigger is for more complex scheduling and follows the cron format found on unix systems. You can find more detailed documentation of the specific implementation on the Quartz.NET site.
    <Trigger Type="Cron">
      <Name>Trigger2</Name>
      <Hour>9</Hour>
      <Minute>02</Minute>
      <DayOfWeek>MON-FRI</DayOfWeek>
    </Trigger>

Properties
* Name: The name of the trigger.
* Year: The year to run it. It defaults to every year.
* Month: The month to run it. It defaults to every month.
* Day: The day to run it. It defaults to every day.
* Hour: The hour to run. It defaults to 0.
* Minute: The minute to run it. It defaults to 0.
* Second: The second to run it. It defaults to 0.
* DayOfWeek: The day of week to run it. It defaults to all.

External References
* http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html
* http://quartznet.sourceforge.net/apidoc/topic285.html

Last edited Jan 4, 2011 at 5:35 PM by nathanpalmer, version 4

Comments

No comments yet.