16.3 Managing Tasks

A task has two components:

ClearCase has a set of standard executable tasks and standard definitions for these tasks in the task database. You cannot create, change, or delete any standard ClearCase tasks or task definitions. You can, however, define new tasks in the task database. You can also customize two predefined ClearCase tasks, one of which is run daily and the other weekly in the default schedule. You can add your own procedures to these tasks and can change their schedules.

To view all task definitions in the task registry, use the following command:

cleartool schedule -get -tasks

Creating a Task

To create a new task:

  1. Create an executable program suitable to be run in the scheduler's execution environment (see Job Execution Environment). You can place the program anywhere in the ClearCase LT server file system, but the recommended location is the directory ccase-var-dir\scheduler\tasks.

  2. If you want the program to run daily, you can run it from the existing task ccase_local_day.[sh|bat]. If you want the program to run weekly, you can run it from the existing task ccase_local_wk.[sh|bat]. Both tasks are in the directory ccase-var-dir\scheduler\tasks. If you add your program to one of these customizable tasks, you need take no further action.

  3. If you prefer to run your program as a new task, you must add the task to the scheduler's task registry, ccase-var-dir/scheduler/tasks/task_registry. To add a task to this file, use a text editor.

  4. Tasks are defined using a job-definition syntax documented on the reference page for the schedule command. The essential components of a task definition are the following:

    WARNING: Place new task definitions at the end of the task registry file. Do not alter or delete any of the standard ClearCase tasks defined in that file.

  5. If you have added a task to the scheduler's task registry, you must create a new job to run the task. See Creating a Job. You do not need to create a new job if you have added your program to an existing scheduled job such as ccase_local_day.[sh|bat].

Editing a Task

You may need to edit an existing task definition in the scheduler's task registry. For example, if you move the task's executable program to another directory, you must change the pathname in the task definition in the task registry.

WARNING: Edit only tasks that have been added at your site. Do not alter or delete any of the standard ClearCase tasks defined in the task registry.

To change a task definition, use a text editor to edit the task registry file, ccase-var-dir\scheduler\tasks\task_registry. When you edit a task, you must use the task-definition syntax documented on the reference page for the schedule command.

CAUTION: The scheduler uses a task definition's numeric ID to refer to the task when it runs a scheduled job that uses that task. If you change a task's numeric ID, you must change all references to the task in all scheduled jobs. See Editing Job Properties.

Deleting a Task

Before you delete a task definition, you must remove all references to the task in all scheduled jobs. See Editing Job Properties. To delete a task definition, use a text editor to edit the task registry file ccase-var-dir\scheduler\tasks\task_registry.

WARNING: Delete only tasks that have been added at your site. Do not alter or delete any of the standard ClearCase tasks defined in the task registry.