A Publish script can be scheduled to run at set times using the scheduler.
Scheduled publish events are configured in an XML file which must be located in a certain location. For a specific project, this location is:
Here is a simple example of configuration file:
<schedule> <event> <start datetime="2010-07-15T07:00:00+10:00" /> <repeat minutes="4" until="2010-07-15T10:00:00+10:00" /> <target name="create-comment"> <description>Create Comments</description> <param name="folder-name" value="tutorials" /> <param name="max-size" value="10" /> </target> </event> <event> <start datetime="2010-07-14T00:00:00+10:00" /> <repeat days="1" daysofweek="mon,tue,wed,thu,fri" until="2010-08-14T00:00:00+10:00" /> <target name="generate-summary"> <description>Produce Daily Summary</description> </target> </event> </schedule>
In the example above, two events are added to the scheduler. When these events are run, the project corresponding to the configuration file is published. That is to say, there is no document being published, only the group parameters are sent to the Ant script (see PageSeeder's Publish parameters for more information).
A publish event must have a
description. Optional fields of the events are: a
repeat frequency and a list of
Repeat frequency is defined by a repeat interval unit (only one of three are allowed:
@days) and the value of the interval. An optional
@until attribute is the end datetime for the repeat field.
@daysofweek attribute restricts the event to run on the days listed and requires a repeat interval of 1 day or less.
Here are examples of repeat frequencies:
<repeat days="7" /> <repeat hours="24" until="2010-12-31T00:00:00+10:00" /> <repeat minutes="15" /> <repeat days="1" daysofweek="thu,fri,sat,sun"/>
Params are the parameters sent to the Ant script, there could be as many as needed.
The corresponding ANT script must be on the ps-publisher in the location below and contain targets with the names specified in the
A jsession ID will not be available to the publish script so it will need a username and password to access PageSeeder. These can be supplied using the
<ps:config> task as follows:
<ps:config file="pageseeder.properties" />
with the following file
pageseeder.properties in the same folder as the
Testing and pausing scripts
After configuring the script, go to the Console page located under the Admin tab and click the refresh icon next to Publishing - Scheduled jobs. The scheduled scripts should then be listed and you can choose Run now to test or Pause/Continue if required. To see the logs for these, View the publish logs.
Created on , last edited on