Versions Compared

Key

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

...

The JobScheduler Command Line Interface (JCLI) can be used to control
JobScheduler control JobScheduler instances (start, stop, status) and job-related objects
such objects such as jobs, job chains, orders, tasks.

...

The JobScheduler Command Line Interface (JCLICLI) is used for the following
areas of operation:

  • work as a replacement for the command scripts
    • JobScheduler start script .\bin\jobscheduler.cmd:
      • provide operations for installing and removing the JobScheduler Windows service
      • starting and stopping JobScheduler instances including active and passive clusters
    • Job Editor (JOE) start script .\bin\jobeditor.cmd
    • JobScheduler Dashboard (JID) start script .\bin\dashboard.cmd
    • JobScheduler Event script .\bin\jobscheduler_event.cmd
  • provide bulk operations:
    • select jobs, job chains, orders and tasks
    • manage orders with operations for start, stop and removal
    • suspend and resume jobs, job chains and orders
    • terminate tasks
  • schedule jobs and orders:
    • add orders to job chains
    • start jobs and orders
  • manage Agents
    • retrieve Agent clusters
    • check Agent status

The JobScheduler CLI provides a number of cmdlets, see PowerShell CLI - Cmdlets

  • The complete list of cmdlets is available with the command:
    • PS C:\> Get-Command -Module JobScheduler
  • Cmdlets come with a full name and two flavors for aliases:The full name includes the term JobScheduler and can be omitted as e.g. inthat includes the term JobScheduler:
    • PS C:\> Use-JobSchedulerMaster
  • The term JobScheduler can be abbreviated to JS:
    • PS C:\> Use-JSMaster
  • The term JobScheduler can further be omitted if the resulting alias does not conflict with existing cmdlets:
    • PS C:\> Use-Master
  • Should conflicts occur with existing cmdlets from other modules then the aliases can be removed
    • PS C:\> Remove-Item alias:Use-Master
    For the following no conflicting aliases are created. This includes aliases for cmdlets from the PowerShell Core no JobScheduler aliases with the same name are created: as e.g. Get-Job, Start-Job, Stop-Job.
    It is recommended to use the abbreviated form Get-JSJob, Start-JSJob etc. Aliases can be forced by use of the cmdlet:
    • PS C:\> . Use-JobSchedulerAlias

Cmdlets consider verbosity and debug settings.

...

The responses from a JobScheduler Master can include large XML answers.
Such answers are stored in temporary files, the debug message indicates the location of the file.
The threshold for creating temporary files is 1000 byte by default.
Consider use of the Set-OptionJobSchedulerOption -DebugMaxOutputSize cmdlet to change this value.

...

  • Import Module
    • PS C:\> Import-Module JobScheduler
      • loads the module from a location that is available with the PowerShell module path,
      • see $env:PSModulePath for predefined module locations.
    • PS C:\> Import-Module C:\some_module_location\JobScheduler
      • loads the module from a specific location, absolute and relative paths can be used.
    • Hints
      • The JCLI module will automatically connect to a Master on import of the module if one of the following environment variables is present:
        • SCHEDULER_URL specifies the URL for which the Master is operated.
        • SCHEDULER_ID specifies the unique identification of a Master.
        • SCHEDULER_HOME specifies the installation path of a locally available Master.
      • You can add the command Import-Module JobScheduler to your PowerShell profile to have the module loaded on start of a PowerShell session, see PowerShell CLI - Use Cases - Credentials Management
  • Use JobScheduler Master Instance
    • As a first operation after importing the module it is required to execute the Use-MasterJobSchedulerMaster cmdlet.
    • PS C:\> Use-JobSchedulerMaster <Url>   or   PS C:\> Use-JobSchedulerMaster -Url <Url> 
      • specifies the URL for which the JobScheduler Master is available. This is the same URL that you would use when opening the JOC GUI in your browser, e.g. http://localhost:4444. If you omit the protocol (HTTP/HTTPS) for the URL then HTTP will be used.
      • allows to execute cmdlets for the specified Master independently from the server and operating system that the JobScheduler Master is operated for, i.e. you can use PowerShell cmdlets to manage a JobScheduler Master running on a Linux box. As an exception to this rule you cannot start a remote JobScheduler Master and you cannot start a remote JobScheduler Windows service, however, you can restart, terminate, abort and suspend any JobScheduler Master on any platform.
      • specifying the URL is not sufficient to manage the Windows Service of the respective Master, see below.
    • PS C:\> PS C:\> Use-JobSchedulerMaster -Id <JobSchedulerID>
      • references the JobScheduler ID that has been assigned during installation of a Master.
      • adds the JobScheduler ID to the assumed installation base path.
        • A typical base bath would be C:\Program Files\sos-berlin.com\jobscheduler
        • The path is added the subdirectory with the value of the JobScheduler ID
    • PS C:\> Use-JobSchedulerMaster -InstallPath <InstallationPath>
      • specifies the full installation path, e.g. C:\Program Files\sos-berlin.com\jobscheduler\scheduler1.10, for a locally available JobScheduler Master.
    • PS C:\> Use-JobSchedulerMaster -InstallPath $env:SCHEDULER_HOME
      • You can use the environment variable SCHEDULER_HOME that points to the installation path.
      • The JobScheduler CLI module on import checks availability of this environment variable.The Use-JobSchedulerMaster cmdlet is executed automatically if SCHEDULER_HOME is present.
    • PS C:\> Use-JobSchedulerMaster -Url <Url> -Id <JobSchedulerID>
      • specify both URL and JobScheduler ID (recommended).
      • determines if the Master with the specified JobSchedulerID is locally available.
    • Hints
  • Manage JobScheduler Objects
    • PS C:\> Show-JobSchedulerStatus
      • shows the summary information for a JobScheduler Master
    • PS C:\> Get-JobSchedulerOrder
      PS C:\> Get-JobSchedulerJobChain
      PS C:\> Get-JobSchedulerJob
      PS C:\> Get-JobSchedulerTask
      • retrieves the list of avaiable objects
    • see the complete list of cmdlets with the cmdlet: Get-Command -Module JobScheduler

...