---
title: "Scheduled jobs"
source: https://dev.pageseeder.com/reference/glossary/scheduled_jobs.html
description: "This document explains how to configure and manage scheduled publish scripts in PageSeeder using XML configuration files, including repeat frequencies, parameters, Ant script setup, and monitoring tools."
last_updated: 2026-08-11T16:33:49+10:00
tokens: ~1398
---

# Scheduled jobs

A [publish script](publish_script.md) can be scheduled to run at set times using the scheduler.

## Configuration

Scheduled publish events are configured in an XML file which must be located in a certain location. For a specific [project](project.md), this location is:

```text
/template/[project]/publish/schedule-config.xml
```

Here is a basic example of configuration file:

```xml
<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" username="system-comments">
      <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" username="jsmith">
        <description>Produce Daily Summary</description>
      </target>
  </event>
</schedule>
```

In the previous example, two events are added to the scheduler. When these events are run, the project corresponding to the script context. That is to say, there is no document being published, only the group properties (for the project) are sent to the Ant script (see [PageSeeder’s Publish parameters](../../guide/publishing.md) for more information).

The `username` attribute requires PageSeeder v6 or higher. It means that the script runs with the corresponding user’s permissions and is able to do anything that user can do. *See following note about permissions in PageSeeder v5.*

A publish event must have a `start/@datetime`, a `target/@name` and `description`. Optional fields of the events are: a `repeat` frequency and a list of `param`.

Repeat frequency is defined by a repeat interval unit (only one of three are allowed: `@minutes`, `@hours` or `@days`) and the value of the interval. An optional `@until` attribute is the end datetime for the repeat field.

An optional `@daysofweek` attribute is a comma-separated list of `mon,tue,wed,thu,fri,sat` or `sun`. It restricts the event to run on the days listed and requires a repeat interval of 1 day or less.

An optional `@daysofmonth` attribute is a comma-separated list of  numbers `1-31`. It restricts the event to run on the days listed and requires a repeat interval of 1 day or less. *Requires PageSeeder v6.3 or higher.*

Here are examples of repeat frequencies:

```xml
<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"/>

<repeat days="1" daysofmonth="1,10,20"/>
```

Params are the parameters sent to the [Ant script](../../guide/configuration/psml/psml_ant_scripts.md), there can be as many as needed. The following param names have special meanings:

- `ps-log-level`: The level of logging the script should output. Allows `info|verbose|warn|error|debug` (default `info`).
- `ps-download-working`: If `true` the working files generated by the script can be download. This might be useful for debugging (default `false`).

> **Note:** The timezone offset in `start/@datetime` is used for the initial start time but all subsequent start times are automatically adjusted for daylight savings time using the server timezone.

## Ant script

The corresponding Ant script must be on the ps-publisher in the following location and contain targets with the names specified in the `publish-config.xml`.

```text
/template/[project]/schedule/build.xml
```

> **Note:** In PageSeeder v5 a jsession ID/token is not available to the publish script so it needs a username and password to access PageSeeder. These can be supplied using the `<ps:config>` task as follows: ```xml <ps:config file="pageseeder.properties" /> ``` with the following file `pageseeder.properties` in the same folder as the `build.xml`. ```text username=system password=mypassword ``` When a password is in a file like this it is more secure to configure it as an API account in case someone gets a copy of the file. API accounts can only access PageSeeder from specified IP addresses and can be configured by adding the following properties for example to the `global.properties` : ```text apiAccountUsernames=system apiAccountIPs=127.0.0.1 ```

## View publish script logs

After configuring the script on the **Publish scripts** page located under **Templates** in the *Administration menu,* click the **refresh** button at the top right of of the table of publish scripts.

You can now **edit** the script or click **open folder** to go to the **Template files** page.

To view the publish logs, go to the *System administration* menu \> **Logs** \> **Publish logs** (system page).

## Testing and pausing scripts

Go to the **Publisher** page on the A*dministration menu \>* **System administration** \> **Server status** \> **Publisher**.

### Current jobs

All the publish jobs running on the server are listed – each job can be monitored and canceled.  The **cancel** button is used to send a request to cancel the job.

### Scheduled jobs

All the scheduled jobs for the server are also listed, along with their configured details, which can be useful for debugging. The **refresh** button is available to load any modifications in the configuration file.

They can be tested without waiting for the scheduled time – click the **Run now** button to test or **Pause/Continue** if required. 

