16.4 Managing Jobs

You can create, delete, or edit jobs run by the ClearCase scheduler. You can also run a scheduled job immediately. To manage a scheduled job on any Windows or UNIX host, use the ClearCase Administration Console. The ClearCase Server snap-in on the console has a Scheduled Jobs node from which you can manage jobs on the ClearCase LT server. If the schedule ACL supports write access (see Managing the Scheduler Access Control List), you can also use the cleartool schedule command on the ClearCase LT server.

To create, edit, delete, or run a scheduled job, you must have Change or Full access in the scheduler ACL. To view scheduled jobs, you must have Read access in the scheduler ACL. See Managing the Scheduler Access Control List.

Creating a Job

When you create a job, you supply the following information:

To create a new job using the ClearCase Administration Console:

  1. In ClearCase Administration Console, navigate to the Scheduled Jobs node for the ClearCase LT server.

  2. Click Action > New > Job. This command opens a dialog box in which you supply the information needed to define a new job.

To create a new job using the command line, use the following command:

cleartool schedule -edit -schedule

This command opens in a text editor a file that contains definitions for all currently scheduled jobs. To create a new job, add a definition using the job-definition syntax documented on the reference page for the schedule command. You cannot specify any read-only job properties, such as LastCompletionInfo. The job runs in the environment described in Job Execution Environment.

Specifying a Job's Schedule

You can arrange for a job to run under two kinds of schedules:

To specify a sequential job, you designate a scheduled job after which the current job is to run. To specify a periodic job, you designate the times when the job is to run. A periodic job can run at four kinds of intervals:

For daily, weekly, and monthly schedules, you can also specify starting and ending dates for the job, and you can set the job to repeat at intervals during the day.

To specify the schedule for a job, use the ClearCase Administration Console:

  1. Navigate to the Scheduled Jobs node of the ClearCase LT server.

  2. To specify the schedule for a new job, click Action > New > Job. This command opens a dialog box in which you supply the information needed to define a new job. After you specify the task, click the Schedule tab to specify the schedule.

  3. To specify the schedule for an existing job, select a job in the detail pane and click Action > Properties. This command opens a dialog box. Click the Schedule tab to specify the schedule.

Or run the following command on the ClearCase LT server:

cleartool schedule -edit -schedule

This command opens in a text editor a file that contains the definitions for all currently scheduled jobs. To specify the schedule for a new or existing job, edit the job's Schedule property using the job-definition syntax documented on the reference page for the schedule command.

Specifying Job Notifications

The scheduler can send e-mail notifications to recipients you specify. You can also determine particular events that trigger notifications, such as the start of a job or the end of a job that fails.

NOTE: Job notifications require the scheduler to contact an SMTP mail server. On Windows, you must specify the name of this server on the Options tab of the ClearCase program in Control Panel on the ClearCase LT server. On UNIX, the scheduler uses the /bin/mail program to send notifications.

To specify the notification information for a job, use the ClearCase Administration Console:

  1. Navigate to the Scheduled Jobs node for the host on which you want to specify a job's notification information.

  2. To specify the notification information for a new job, click Action > New > Job. In the dialog box, supply the information needed to define a new job. After you specify the task, click the Settings tab to specify notification events and recipients.

  3. To specify the notification information for an existing job, select a job in the detail pane and click Action > Properties. In the dialog box, click the Settings tab to specify notification events and recipients.

Or use the following command:

cleartool schedule -edit -schedule

This command opens in a text editor a file that contains definitions for all currently scheduled jobs. To specify the notification information for a new or existing job, edit the job's NotifyInfo property using the job-definition syntax documented on the reference page for the schedule command.

Viewing Job Properties

To view properties of a scheduled job, use the ClearCase Administration Console:

  1. Navigate to the Scheduled Jobs node for the ClearCase LT server.

  2. Select a job in the detail pane and click Action > Properties. In the dialog box, you can view properties of the job.

  3. To view messages and information such as time and status from the last execution of the job, select the job in the detail pane and click Action > Show Completion Details.

Or use the following commands on the ClearCase LT server:

cleartool schedule -get -schedule

To view the definition of a particular job, use the following command:

cleartool schedule -get -job job-id-or-name

To view messages and information such as time and status from the last execution of the job, use the following command:

cleartool schedule -status job-id-or-name

These commands display properties of jobs using the job-definition syntax documented on the reference page for the schedule command.

Editing Job Properties

To edit an existing job, use the ClearCase Administration Console:

  1. Navigate to the Scheduled Jobs node for the ClearCase LT server.

  2. Select a job in the detail pane and click Action > Properties. This command opens a dialog box in which you can edit properties of the job. You cannot edit any read-only job properties.

Or use the following command:

cleartool schedule -edit -schedule

This command opens in a text editor a file that contains definitions for all currently scheduled jobs. Edit the properties of the job using the job-definition syntax documented on the reference page for the schedule command. You cannot edit any read-only job properties, such as LastCompletionInfo.

If you have a text file of job definitions that uses the scheduler's job-definition syntax, you can replace the entire schedule with the job definitions in your file by running the following command, where defn_file_pname represents your file of job definitions:

cleartool schedule -set -schedule defn_file_pname

Running a Job Immediately

To run a scheduled job immediately, use the ClearCase Administration Console:

  1. Navigate to the Scheduled Jobs node for the ClearCase LT server.

  2. Select the job in the detail pane and click Action > Run Now.

Or use the following command:

cleartool schedule -run job-id-or-name

The job runs in the scheduler's execution environment. See Job Execution Environment.

Deleting a Job

To delete a scheduled job, use the ClearCase Administration Console:

  1. Navigate to the Scheduled Jobs node for the ClearCase LT server.

  2. Select a job in the detail pane and click Action > Delete Job.

Or use the following command:

cleartool schedule -delete job-id-or-name