Creating a task

A set of standard tasks and a schedule for running them is installed on every host that supports local VOBs and views. Although you cannot create, change, or delete any standard tasks, you can define new tasks. You can also customize two predefined tasks, one of which runs daily and the other weekly in the default schedule, to add your own procedures to them and change their schedules.

About this task

A task has two components:
  • A job (executable program or script) to be run when the task runs
  • A definition for the task in the scheduler's task registry

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

cleartool schedule –get –tasks

Procedure

  1. Create an executable program that can run in the scheduler's execution environment. (See the schedule reference page.)
    You can place this program in the scheduler's tasks directory.
    • If you want the program to run daily, you can run it from the existing task ccase_local_day. If you want the program to run weekly, you can run it from the existing task ccase_local_wk. Both tasks are in the scheduler's tasks directory, and are scripts with a .sh suffix on Linux® or the UNIX® system, and a .bat suffix on Windows. If you add your program to one of these customizable tasks, you need take no further action.
    • If you prefer to run your program as a new task, you must add the task to the task_registry file in the scheduler's tasks directory. To add a task to this file, use a text editor. Tasks are defined with a job-definition syntax that is documented on the schedule reference page.
      Attention: Place new task definitions at the end of the task registry file. Do not alter or delete any of the standard tasks defined in that file.
      A task definition includes these essential components:
      • A unique numeric ID used by a job to refer to the task
      • A unique name for the task
      • The pathname to the executable program associated with the task
  2. After you have added a task to the 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.