Skip to end of metadata
Go to start of metadata

Use of Environment Variables

  • JobScheduler provides a number of environment variables that are available to the job tasks environment
  • These environment variables are valid on the host where JobScheduler Master and Agent are executed. 
  • Use of the environment variable syntax depends on the operating system:
    • For Windows use %SCHEDULER_JOB_NAME%
    • For Unix use $SCHEDULER_JOB_NAME or ${SCHEDULER_JOB_NAME}
  • Mixed spelling with uppercase and lowercase letters is handled differently depending on the operating system:
    • For Windows any mixed spelling can be used, i.e. %SCHEDULER_JOB_NAME%, %Scheduler_Job_Name%, %SCHEDULER_job_name% will address the same environment variable.
    • For Unix the exact spelling has to be used, i.e.  $SCHEDULER_JOB_NAME, $Scheduler_Job_Name, $SCHEDULER_job_name represent different environment variables, only the first one is valid.

List of generally available Environment Variables

Environment Variable ExampleDescription
SCHEDULER_IDSCHEDULER-1-10-2identification of JobScheduler instances as specified during installation
SCHEDULER_JOB_NAMEsample_jobjob name
SCHEDULER_JOB_CHAINsample_job_chainjob chain name
SCHEDULER_PARAM_... parameters are povided with their name and the prefix SCHEDULER_PARAM_ 1)
JS-1517 - Agent should consider changes to environment variable name prefix for parameters Released  
SCHEDULER_PARAM_SCHEDULER_FILE_PATHC:\Windows\INCOMGING_FILES\test.pdfpath of the file that causes a job chain to start by <file_order_source>; variable is prefixed with SCHEDULER_PARAM_ 1), see File Watching
SCHEDULER_TASK_TRIGGER_FILES
C:\Windows\INCOMGING_FILES\test1.pdf;C:\Windows\INCOMGING_FILES\test2.pdfsemicolon-separated list of files that cause a job to be started, see Directory Monitoring
SCHEDULER_TASK_ID4711unique numerical identifier of every task run by a JobScheduler
SCHEDULER_ORDER_IDend_of_day_processingorder identification
SCHEDULER_ORDER_HISTORY_ID123456789unique numerical identifier for an order run
JS-1513 - JobScheduler exposes a unique id for an order run Released  
SCHEDULER_RETURN_VALUESC:\Windows\TEMP\sosDF2C.tmplocation of temporay file that stores return values (name=value) for successor jobs
SCHEDULER_JOB_CONFIGURATION_DIRECTORYC:/ProgramData/sos-berlin.com/jobscheduler/scheduler/config/live/exampleslocation of current folder with job objects
SCHEDULER_CONFIGURATION_DIRECTORYC:/ProgramData/sos-berlin.com/jobscheduler/scheduler/config/live location of live folder
SCHEDULER_DATAC:/ProgramData/sos-berlin.com/jobscheduler/scheduler/scheduler_datalocation of data directory
SCHEDULER_HOMEC:/ProgramData/sos-berlin.com/jobscheduler/scheduler location of installation directory
SCHEDULER_HOSTlocalhosthost with JobScheduler installation
SCHEDULER_TCP_PORT4444TCP port that JobScheduler listens to
SCHEDULER_UDP_PORT4444UDP port that JobScheduler listens to
SCHEDULER_SUPERVISOR_HOSTlocalhostHostname of a Supervisor JobScheduler if configured as <config supervisor="..." > in ./config/scheduler.xml
SCHEDULER_SUPERVISOR_PORT4444TCP port of a Supervisor JobScheduler if configured as <config supervisor="..." > in ./config/scheduler.xml

List of job specific Environment Variables 

Environment Variable JobDescription
SCHEDULER_SOSFILEOPERATIONS_RESULTSETYADE JITL JobA colon separated list of file names for the files that have been transferred

List of Environment Variables available with Agents

Environment Variable ExampleDescription
SCHEDULER_ORDER_STATEstartstate of the node that the crder currently passes
SCHEDULER_TASKSTART_DATE01.12.2017 09:13:59+0100Date in country format as specified by LANG environment variable
SCHEDULER_TASKSTART_DATE_ISO2017-12-01T09:13:59+0100Date in ISO format
SCHEDULER_TASKSTART_DAY31Day of task start time
SCHEDULER_TASKSTART_MONTH12Month of task start time
SCHEDULER_TASKSTART_YEAR2017Year of task start time
SCHEDULER_TASKSTART_HOUR23Hour of task start time
SCHEDULER_TASKSTART_MINUTE59Minute of task start time
SCHEDULER_TASKSTART_SECOND32Second of task start time

Explanations

  1. For job parameters the default setting is to be prefixed with SCHEDULER_PARAM_, e.g. the parameter hostname will become SCHEDULER_PARAM_HOSTNAME.
    • You can modify this behavior by specifying job parameters to be used without any prefix. This can be achieved by adding the following parameter configuration to your ./config/scheduler.xml file and by restarting JobScheduler:

      With this setting a parameter hostname will be provided with the environment variable HOSTNAME.

    • You can use an arbitrary prefix by specifying:

      With this setting a parameter hostname will be provided with the environment variable MY_SCHEDULER_PARAM_HOSTNAME.

       
    • The default value is provided by the implicit setting:

      With this setting a parameter hostname will be provided with the environment variable SCHEDULER_PARAM_HOSTNAME.

 

  • No labels