Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Stop-JobSchedulerTask

SYNOPSIS

Stops a number of tasks in the JobScheduler Master.

SYNTAX

Stop-JobSchedulerTask [[-JobTask] <String> ] [[-DirectoryJob] <String> ] [[-TasksAction] <PSObject[<String>] >] [[-Timeout] <Int32>] [-Terminate] [[-AuditComment] <String>] [[-AuditTimeSpent] <Int32>] [[-AuditTicketLink] <Uri>] [<CommonParameters>]

DESCRIPTION

Stopping tasks includes operations to terminate tasks, e.g. 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.cmdlet
* by specifying an individual task with the -Task and -Job parameters.

PARAMETERS

...

Task

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

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

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

...

Job

-Directory Job <String>
Optionally specifies the folder path and name of a job for which jobs tasks should be stoppedterminated. The directory is determined
from the root folder, i.e. the "live" directory.

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

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

...

Action

-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. Action <String>
Specifies the action to be applied to stop a task:

* Action "terminate"
** For shell jobs
*** in a Unix environment the task is sent a SIGTERM signal and - in case of the timeout parameter being used -
after expiration of the timeout a SIGKILL signal is sent.
*** in a Windows environment the task is killed immediately.
** For API jobs
*** the method spooler_process() of the respective job will not be called by JobScheduler any more.
*** the task is expected to terminate normally after completion of its spooler_process() method.

* Action "kill"
** tasks are killed immediately.

Default: "kill"

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

...

-Timeout <Int32>
Specifies a timeout to be applied when stopping a task without using by use of the parameter -KillAction with the value "terminate".

* 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 value010
Accept pipeline input?true (ByPropertyName)Accept wildcard characters?false

Terminate

...

...

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

AuditComment

...

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

...

...

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

...

about_jobscheduler

...

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

PS > GetStop-JobSchedulerTask -Task 81073 -Job /sos/dailyschedule/CheckDaysSchedule

Terminates an individual task.

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

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

Kills Terminates all running and enqueued tasks for all jobs.

-------------------------- EXAMPLE 2 3 --------------------------

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

Terminates all running and enqueued tasks that are configured with the root folder ("some_path" and any sub-folderslive" directory) without consideration of subfolders. For Unix environments tasks are sent a SIGTERM signal and after expiration of 30s a SIGKILL signal is sent.

-------------------------- EXAMPLE 3 4 --------------------------

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

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