Skip to main content

Administrating MarkLogic Server

Scheduling a Module for Invocation

To schedule a module for invocation at a particular date/time or interval, follow these steps:

  1. Click the Groups icon in the left tree menu.

  2. Click the group in which you want to schedule a task (for example, Default).

  3. Click the Scheduled Tasks icon on the left tree menu.

  4. Click the Create tab to bring up the Schedule a Task page.

  5. Specify the URI for the module to invoke in the Task Path field. The task path must begin with a forward slash (/) and cannot contain a question mark (?), colon (:) or pound (#) character.

  6. In the Task Root field, specify the root directory (file system) or URI root (database) that contains the module.

  7. In the Task Type field, select one of the task types described in Selecting a Task Type.

  8. In the Database field, select the database on which to invoke the module.

  9. In the Task Modules field, select either the file system or the database that contains the module specified in the Task Path field.

    If Task Modules is set to (file system), then place the module in the directory specified by Task Root. The file will be located on disk with a path that is the Task Root combined with the Task Path. For example, if Task Root is /marklogic/modules and Task Path is /tasks/test.xqy, then test.xqy should be located at /marklogic/modules/tasks/test.xqy on the file system.

    If Task Modules is set to a database, then load the module into that database under the URI root specified by Task Root. For example, for the configuration shown in Step 10, test.xqy should be inserted into the Modules database at URI /marklogic/modules/test.xqy.

  10. In the Task User and Task Host fields, specify the user with permission to invoke the task and the host computer on which the task is to be invoked. If no host is specified, then the task runs on all hosts.

    Note

    The user specified in the Task User field must have the privileges required to execute the functions used in the module. See Appendix B: Pre-defined Execute Privileges for the full list of execute privileges.

    Example of a Scheduled Task configuration:

    scheduling_tasks-1_v10.png