Versions Compared

Key

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

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px
How can i add environment variables to JobScheduler?
The commandline

Using Command Line Options

  • The command line option -env=[var_name]=[var_value] adds an environment variable to the

...

  • JobScheduler.
    • This variable

...

    • only exists in the scope of the

...

    • JobScheduler.
  • If a variable [var_name] already exists in the user environment then the value of the -env option

...

  • will become effective.

...

  • The Windows Service of the

...

  • JobScheduler reads

...

  • the system and user environment only if it

...

  • runs in the corresponding user account.

...

...

Start Script with -env

Sample Example for starting the Job Scheduler JobScheduler with the an environment variable hellh1. world:

Code Block

 unix-shell>[install_path]/bin/jobscheduler.sh start -env="hello=world" 
 windows-shell>[install_path]\bin\jobscheduler.cmd start -env="hello=world"

...

Environment Variables Script: jobscheduler_environment_variables.(sh|cmd)

...

The JobScheduler start script reads the environment from the .\user_bin\jobscheduler_environment_variables.(sh|cmd) script.

  • You will find an example in ./user_

...

  • bin/jobscheduler_environment_variables.(sh|cmd)-example.
  • Rename this file

...

  • to ./user_bin/jobscheduler_environment_variables.(sh|cmd) to make it effective.
  • For Unix make sure that ./user_bin/jobscheduler_environment_variables.sh is readable and executable.
  • Edit ./user_bin/jobscheduler_environment_variables.(sh|cmd) if you always want to start the JobScheduler with additional environment variables. If you want to start the JobScheduler Windows service with the -env option then a reinstall is required (see below).

Sample Example snippet of [install_path]/user_bin/jobscheduler_environment_variables.(sh|cmd) for adding the an environment variable helloworld:

Code Block

 ...
 # unix sample
 export SCHEDULER_PARAMShello="world"
 export PERL5LIB=`perl -e 'print join ":", @INC'`
 export TMP="${SCHEDULER_DATA}/tmp"
 ...
Code Block
"... \"-env=hello=world\" ..."
 ...
 rem windows sample
 setSET SCHEDULER_PARAMS=...%SCHEDULER_PARAMS% -env="hello=world" ... 
 SET SCHEDULER_START_PARAMS=%SCHEDULER_START_PARAMS% -env="hello=world"
 ...

Windows Service

A windows service starts the Job Scheduler always with that options which it is installed. After the windows Job Scheduler setup a service is already installed so that it must be reinstalled with additional environment variables.

For this close the services dialog (services.msc) if necessary and ...

  • stop the Job Scheduler if necessary

The Windows Service always starts JobScheduler with the options and environment variables that have been used for installation. During the Windows JobScheduler setup a Windows Service is installed that has to be re-installed in order to make new environment variables effective.

For this:

  • stop the JobScheduler if it is running:
Code Block
Code Block

 windows-shell>[install_path]\bin\jobscheduler.cmd stop
  • remove the Job Scheduler JobScheduler service:
Code Block

 windows-shell>[install_path]\bin\jobscheduler.cmd remove
  • install the Job Scheduler JobScheduler service with -env option or edit the jobscheduler_environment_variables.cmd file like as stated above
Code Block

 windows-shell>[install_path]\bin\jobscheduler.cmd install -env=hello=world
 ...or...
 windows-shell>[install_path]\bin\jobscheduler.cmd install
 
  • start the Job Scheduler JobScheduler service:
Code Block

 windows-shell>[install_path]\bin\jobscheduler.cmd start_service