Name

Stop-JobSchedulerTask

SYNOPSIS

Stops tasks in the JobScheduler Master.

SYNTAX

Stop-JobSchedulerTask [[-Job] <String>] [[-Directory] <String>] [[-Tasks] <PSObject[]>] [[-Timeout] <Int32>] [-Terminate] [[-AuditComment] <String>] [[-AuditTimeSpent] <Int32>] [[-AuditTicketLink] <Uri>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Stopping tasks includes operations to terminate tasks by use of a SIGTERM signal, and to kill tasks immediately with a SIGKILL signal.

Tasks to be stopped are selected

* by a pipelined object, e.g. the output of the Get-JobSchedulerTask or Get-JobSchedulerJob cmdlets.
* by specifying an individual task with the -Task and -Job parameters.

PARAMETERS

Job

-Job <String>
Optionally specifies the path and name of a job for which tasks should be terminated.

Both parameters -Task and -Job have to be specified if no pipelined task objects are used.

Required?false
Position?1
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Directory

-Directory <String>
Optionally specifies the folder for which jobs should be stopped. The directory is determined
from the root folder, i.e. the "live" directory.

Required?false
Position?2
Default value/
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Tasks

-Tasks <PSObject[]>
Optionally specifies the identifier of a task that includes the properties "path" and "taskId".
Task information as returned by the Get-JobSchedulerJob and Get-JobSchedulerTask cmdlets can
be used for pipelined input into this cmdlet.

Required?false
Position?3
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

Timeout

-Timeout <Int32>
Specifies a timeout to be applied when stopping a task without using the parameter -Kill.

* For shell jobs
** in Unix environments the task is sent a SIGTERM signal and after expiration of the timeout a SIGKILL signal is sent.
** in Windows environments the timeout is ignored.
* For API jobs
** the method spooler_process() of the respective job will not be called by JobScheduler any more.
** should the job not complete its spooler_process() method within the timeout then the task will be killed.

Required?false
Position?4
Default value0
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Terminate

-Terminate <SwitchParameter>
Specifies that tasks should not be killed immediately. Instead a SIGTERM signal is sent
and optionally the -Timeout parameter is considered.

This parameter is applicable for jobs running on Unix environments only.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

AuditComment

-AuditComment <String>
Specifies a free text that indicates the reason for the current intervention,
e.g. "business requirement", "maintenance window" etc.

The Audit Comment is visible from the Audit Log view of JOC Cockpit.
This parameter is not mandatory, however, JOC Cockpit can be configured
to enforece Audit Log comments for any interventions.

Required?false
Position?5
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

AuditTimeSpent

-AuditTimeSpent <Int32>
Specifies the duration in minutes that the current intervention required.

This information is visible with the Audit Log view. It can be useful when integrated
with a ticket system that logs the time spent on interventions with JobScheduler.

Required?false
Position?6
Default value0
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

-AuditTicketLink <Uri>
Specifies a URL to a ticket system that keeps track of any interventions performed for JobScheduler.

This information is visible with the Audit Log view of JOC Cockpit.
It can be useful when integrated with a ticket system that logs interventions with JobScheduler.

Required?false
Position?7
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

WhatIf

-WhatIf <SwitchParameter>

Required?false
Position?named
Default value
Accept pipeline input?false
Accept wildcard characters?false

Confirm

-Confirm <SwitchParameter>

Required?false
Position?named
Default value
Accept pipeline input?false
Accept wildcard characters?false

about_JobScheduler

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > Get-JobSchedulerTask -Running -Enqueued | Stop-JobSchedulerTask

Kills all running and enqueued tasks for all jobs.

-------------------------- EXAMPLE 2 --------------------------

PS > Get-JobSchedulerTask -Directory /some_path -Recursive -Running -Enqueued | Stop-JobSchedulerTask -Terminate -Timeout 30

Terminates all running and enqueued tasks that are configured with the folder "some_path" and any sub-folders. For Unix environments tasks are sent a SIGTERM signal and after expiration of 30s a SIGKILL signal is sent.

-------------------------- EXAMPLE 3 --------------------------

PS > Get-JobSchedulerTask -Job /test/globals/job1 | Stop-JobSchedulerTask

Kills all running tasks for job "job1" from the folder "/test/globals".

  • No labels