Concord/NhSchedule

Schedule a new job
to schedule a monthly report we can use the below... Note the at the end of the first line this is a "\" becouse the args  oftern take up more space then unix alows on one line.

nhSchedule -schedule "Health" -time "1:00" -monthly "1" -args "-rptType health -rptName $ReportTemplate \ -subjType group -elemType wanIf -subjName $GROUP -autoRange lastMonth -protocols all -namesType aliases -web Monthly_$(SUBJECT)_$(DATE)_$(TIME)"

nhSchedule -schedule "Health" -time "1:00" -monthly "1" -args " -rptType health -rptName FrameConnect -subjType group -elemType wanIf \  -subjName ABNA -autoRange lastMonth -protocols all -namesType aliases -web Monthly_$(SUBJECT)_$(DATE)_$(TIME)"

List Schedule Jobs
nhSchedule -list -full > list.of.schedule.jobs.list

delete a Schedule job
nhSchedule -delete "jobID"

nhSchedule -h
nhSchedule schedules and manages jobs that you want to run regularly. eHealth provides several predefined job types: Data Analysis, Update Views, Cleanup Nodes, Name Nodes, Delete Old Reports, Delete Database Archive, Maintenance, Find Cluster Differences, Conversations Rollup, Live Exceptions History and Live Exceptions Baseline, and Statistics Rollup. You can create new job types for any operating system or eHealth command that the eHealth user can run.

To list a specific job or all scheduled jobs, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -list [ -type "" ] [ -full ]

To list all job type that you can schedule, use the following syntax:

nhSchedule -listTypes

To enable a scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -enable 

To disable a scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -disable 

To add a scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -schedule "" [ -jobId  ] -time " " { -daily | -monthly  | -period  } [ -args " " ]

To modify a scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -modify  [ -time " " ] { -daily | -monthly  | -period  } [ -args " " ]

To delete a scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -delete 

To delete a job type, use the following syntax:

nhSchedule -deleteType <"typeName">

To create a specific type of scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -defineType "" -load -cmd ' '

To modify a specific type of scheduled job, use the following syntax:

nhSchedule [ -host | -cluster | -all ] -modifyType "" -load -cmd ' '

To indicate the cluster systems that nhSchedule should affect, use the following syntax:

nhSchedule [ -host | -cluster | -all ] 

-h  (Optional) Displays this command usage.

-host (Optional) In a Distributed eHealth cluster, specifies the name of the eHealth system on which you want to run the command. You can specify this argument if you do not specify -cluster or -all.

-cluster (Optional) In a Distributed eHealth cluster, runs the command on all eHealth systems in the cluster except the local system. You can specify this argument if you do not specify -host or -all.

-all (Optional) In a Distributed eHealth cluster, runs the command on all eHealth systems in the cluster. You can specify this argument if you do    not specify -host or -cluster.

 (Required to identify cluster systems) Specifies the other arguments that you can use to create and control scheduled jobs.

-list (Required to list jobs) Lists one or more scheduled jobs.

-enable  (Required to enable jobs) Enables the specified disabled job, which causes a disabled scheduled job to run as scheduled.

-disable <jobId> (Required to disable jobs) Disables the specified job. A disabled job remains in the schedule queue, but it does not run until it is enabled.

-schedule "<typeName>" (Required to schedule a job) Specifies the job to schedule. <typeName> must be enclosed in quotation marks (" "). To list the available job types, specify -listTypes. This argument is required when scheduling a    system job.

-modify <jobId> (Required to modify a job) Modifies the specified job.

-delete <jobId> (Required to delete a job) Deletes the specified job and removes it    from the schedule queue.

-type "<typeName>" (Optional) Specifies the job type to list. You must specify the job type in quotation marks (" ").

-jobId <jobId> (Optional) Assigns a job ID to the scheduled job at creation time or    specifies the job ID from the job list. Duplicate job IDs are not permitted.

-listTypes (Required to list all job types) Lists all job types that you can schedule, including predefined job types and any user-defined types.

-defineType "<typeName>" (Required to create a job type) Specifies the name of the job type to    create. Enclose <typeName> in quotation marks (" "). After you create a job type, you can schedule it.

-full (Optional) Shows any arguments specified for the job.

-modifyType "<typeName>" (Required) Modifies the specified type of scheduled job. <typeName> must be enclosed in quotation marks (" ").

-deleteType "<typeName>" (Required to delete a job type) Specifies the eHealth job type to    delete. Must enclose <typeName> in quotation marks (" ").

-cmd ' ' (Required to create or modify a job type) Specifies the command that you want to add as a job type. You must specify the full pathname. You can also specify the necessary arguments. The command and arguments must be enclosed in quotation marks (' '). You must specify this argument last.

-load (Required to create or modify a job type) Specifies the percentage of    system resources that this command is expected to use while running. You can specify values of 10, 20, 30, 40, 50, 60, 70, 80, 90, and 100 percent. If you schedule several jobs to run at the same time, eHealth runs as many jobs as possible, up to a cumulative load of 100%.

-time " " (Required to schedule or modify a job) Specifies the time to run the job. must be enclosed in quotation marks (" "). Enter the time in the format specified at installation. For example, specify one of    the following: "17:30" or "5:30 PM". If you use it with -daily or    -monthly, it specifies the time of day to start the job. If you use it    with -period, it specifies the first execution of the command.

-daily (Required) Specifies the days of the week on which to run the command. Enter y to run the command on that day or n to not run the command, starting with Sunday. For example, to run the command on Monday through Friday, specify: nyyyyyn. You must enter seven letters. When scheduling or modifying a system job, you must specify this argument if you do not specify -monthly or -period.

-monthly <nn> (Required) Specifies the day of the month on which to run the job. You can enter values from 1 to 31. If you specify -monthly 31, eHealth will run the scheduled job on the 31st of each month that contains 31 days. eHealth does not run the job for months that contain less than 31 days. When scheduling or modifying a system job, you must specify this argument if you do not specify -daily or -period.

-period <i> (Required) Specifies the interval in hours to run the command. You can enter 1, 2, 4, 6, 8, or 12 hours. When scheduling or modifying a system job, you must specify this argument if you do not specify -monthly or    -daily.

-args " " (Optional) Specifies the command arguments to include. The arguments must be enclosed in quotation marks (" "). This argument is optional when scheduling a system job. If you do specify it, it must be the last argument.

The following example lists all scheduled jobs and displays any arguments specified for the jobs:

nhSchedule -list -full

-JobId- -Days -Status- -RunTime- -Name 100000 Every 4 hours    Enabled  05/16/02 12:05:00 Conversations Rollup 100001 Su,M,Tu,W,Th,F,Sa Enabled 01/01/02 00:05:00 Statistics Rollup 100020 Th               Enabled  02/05/02 01:00:00 ServerRpt -s -type svr -scope day -cf Standard.cfg -scheduled

The following example enables a disabled job with a job ID of 1000002:

nhSchedule -enable 1000002

The following example disables a scheduled job with a job ID of 1000002:

nhSchedule -disable 1000002

The following example adds a node-naming job at 2:30 a.m. each Monday:

nhSchedule -schedule "Name Nodes" -time "2:30 AM" -daily nynnnnn -args "-dns"

The following example schedules a node-naming job with a job ID of 1000100 to run every 12 hours starting at 6:00 p.m:

nhSchedule -schedule "Name Nodes" -jobId 100017 -time "06:00 PM" -period 12 -args "-dns"

The following example schedules a node-naming job to run at 2:00 a.m. on the first day of every month:

nhSchedule -schedule "Name Nodes" -time "02:00 AM" -monthly 1 -args "-dns"

The following example modifies a scheduled job (job ID 1000600) to run every 12 hours starting at 6:00 p.m:

nhSchedule -modify 100060 -time "6:00 PM" -period 12 - args "-testarg"

The following example deletes a scheduled job with a job ID of 1000002:

nhSchedule -delete 1000002

The following example enables a disabled job with a job ID of 1000002 on the eHealth system named max:

nhSchedule -host max -enable 1000002

The following example disables a scheduled job with a job ID of 1000002 on all eHealth systems in the cluster except the local system:

nhSchedule -cluster -disable 1000002

For more information, refer to the eHealth Administration Reference.