Job - addWeeklyScheduleWithPriority

Job - addWeeklyScheduleWithPriority

Description :

This command adds a weekly schedule to a job with a specified priority .This command is not supported if approval is enabled for the job type.

The argument jobKey is a handle to the job being modified. To find the jobKey for a specific job type, use the SnapshotJob getDBKeyByGroupAndName command.

The dateString argument defines a weekly schedule to be added to the job definition. It must be in the format YYYY-MM-DD HH:MM:SS. Use the daysOfWeek argument to specify a sum representing the days when the job should execute. Each day of the week has a value, as shown below:

  • SUNDAY=1
  • MONDAY=2
  • TUESDAY=4
  • WEDNESDAY=8
  • THURSDAY=16
  • FRIDAY=32
  • SATURDAY=64

Add values representing the days when you want the job to run. For example, if you want the job to run on Monday, Wednesday, and Friday, then daysOfWeek=42. Use the frequency argument to specify an interval in weeks for the job to run (for example, 2 means the job runs every other week).

Set priorityString to one of the following priorities:

  • CRITICAL
  • HIGH
  • NORMAL
  • LOW
  • LOWEST

This command does not send a job notification. To add a schedule that includes notifications, see the Job addWeeklyScheduleWithSNMPNotificationAndPriority or Job addWeeklyScheduleWithEMailNotificationAndPriority commands.

Return type : java.lang.Object

Command Input :

Variable Name

Variable Type

Description

jobKey

com.bladelogic.om.infra.model.base.keys.SJobKey

Handle to the job.

dateString

String

Weekly schedule to be added. The date string must be in the format YYYY-MM-DD HH:MM:SS.

daysOfWeek

Integer

Days of the week when the job should execute. See above for a more detailed description.

frequency

Integer

Interval in weeks when the job should run.

priorityString

String

Priority of weekly schedule to be added.

Example

The following example shows how to add weekly job run with high priority to a job. In the example, the job runs every three weeks at 11:35 PM on Monday, Wednesday, and Friday.

Script





DATE_STRING="2005-01-01 23:35:00" 

PRIORITY_STRING=HIGH 

DAYS_OF_WEEK=42 

FREQUENCY=3 

JOB_KEY=`blcli SnapshotJob getDBKeyByGroupAndName /snapshots snapconfig` 

JOB_KEY=`blcli Job addWeeklyScheduleWithPriority $JOB_KEY "$DATE_STRING" $DAYS_OF_WEEK $FREQUENCY $PRIORITY_STRING` 



Was this page helpful? Yes No Submitting... Thank you

Comments