Use of Environment Variables
- JobScheduler provides a number of environment variables that are available to all jobs.
- These environment variables are valid on the host where JobScheduler is 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}
- For Windows use
- 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.
- For Windows any mixed spelling can be used, i.e.
List of Environment Variables
Environment Variable | Example | Description |
---|---|---|
SCHEDULER_JOB_NAME | sample_job | job name |
SCHEDULER_JOB_CHAIN_NAME | sample_job_chain | job chain name |
SCHEDULER_PARAM_... | parameters are povided with their name and the prefix SCHEDULER_PARAM_ 1) | |
SCHEDULER_TASK_ID | 4711 | process id (pid) of task |
SCHEDULER_ORDER_ID | end_of_day_processing | order identification |
SCHEDULER_RETURN_VALUES | C:\Windows\TEMP\sosDF2C.tmp | location of temporay file that stores return values (name=value ) for successor jobs |
SCHEDULER_JOB_CONFIGURATION_DIRECTORY | C:/ProgramData/sos-berlin.com/jobscheduler/scheduler/config/live/examples/06_JADEFileTransfer | location of current folder with job objects |
SCHEDULER_CONFIGURATION_DIRECTORY | C:/ProgramData/sos-berlin.com/jobscheduler/scheduler/config/live | location of live folder |
SCHEDULER_DATA | C:/ProgramData/sos-berlin.com/jobscheduler/scheduler/scheduler_data | location of data directory |
SCHEDULER_HOME | C:/ProgramData/sos-berlin.com/jobscheduler/scheduler | location of installation directory |
SCHEDULER_HOST | localhost | host with JobScheduler installation |
SCHEDULER_TCP_PORT | 4444 | TCP port that JobScheduler listens to |
SCHEDULER_UDP_PORT | 4444 | UDP port that JobScheduler listens to |
Explanations
- For job parameters the default setting is to be prefixed with
SCHEDULER_PARAM_
, e.g. the parameterhostname
will becomeSCHEDULER_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:<params> <param name="scheduler.variable_name_prefix" value="*NONE"/> </params>
With this setting a parameter
hostname
will be provided with the environment variableHOSTNAME.
You can use an arbitrary prefix by specifying:
<params> <param name="scheduler.variable_name_prefix" value="MY_SCHEDULER_PARAM_"/> </params>
With this setting a parameter
hostname
will be provided with the environment variableMY_SCHEDULER_PARAM_HOSTNAME.
The default value is provided by the implicit setting:
<params> <param name="scheduler.variable_name_prefix" value="SCHEDULER_PARAM_"/> </params>
With this setting a parameter
hostname
will be provided with the environment variableSCHEDULER_PARAM_HOSTNAME.