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

User defined Parameters in Shell-Scripts

...

Job parameter and order params are accessible by the use of environment variables. There is a name convention. The name of the environment variable according to a parameter is SCHEDULER_PARAM_NAMEOFPARAM. For example the job parameter param1 is available by the environment variable SCHEDULER_PARAM_PARAM1 (always in upper case letters).

Sample

Code Block
 <job>
    <params>
        <param name="param1"  value="Test"/>
    </params>
    <script language="shell">
        <![CDATA[
 rem This is a sample shell script to demonstrate the use of parameters
 echo Param1 has the value %scheduler_param_param1%
        ]]>
    </script>
    <run_time/>
 </job>

...

Code Block
 <job>
    <params>
        <param name="param1" value="Test"/>
    </params>
    <script language="shell">
        <![CDATA[
 # This is a sample shell script to demonstrate the use of parameters
 echo Param1 has the value $SCHEDULER_PARAM_PARAM1
        ]]>
    </script>
    <run_time/>
 </job

If you want to use the parameters as parameters for a script in the command-line just append the Names to the Scriptname:

Code Block

  anyshellscript.sh $SCHEDULER_PARAM_PARAM1 $SCHEDULER_PARAM_PARM2 ...

...

Setting Parameter in Shell-Scripts and put them to the next node in job chains.

...

At every change of status in job chains Job Scheduler parses a temporary file for name "namh1. value" pairs. Thes name value The "namevalue" pairs will be set as order params. The name of the temporary file is availabe with the environment variable SCHEDULER_RETURN_VALUES.

...