Menu

How to receive the parameters from XML job?

Help
iwsyang
2015-09-18
2015-10-12
  • iwsyang

    iwsyang - 2015-09-18

    If the job contains a paramenter "-t dddddddddddddddddddddd" , how could I receive this param from the 'GO' script?

    <job title="yang_test3" name="yang_test3"> <settings> <mail_on_success></mail_on_success> <log_mail_to></log_mail_to> </settings> <process file="/home/yliu/scripts/ruby/hello_world/job" param="-t dddddddddddddddddddddd "> <environment/> </process> <run_time once="yes" begin="16:00:00" end="17:00:00" repeat="00:03:00"/> </job>
     
  • Andreas

    Andreas - 2015-10-12

    Hi,

    use of the <process> element is deprecated, see JS-1295. Instead use the <script> element with slightly different parameter specification:

    <?xml version="1.0" encoding="UTF-8"?>
    <job name="yang_test">
       <params>
           <param name="what" value="dddddd"/>
       </params>
       <script language="shell">
           <![CDATA[echo hello world $SCHEDULER_PARAM_WHAT"]]>
        </script>
        <run_time once="yes" begin="16:00:00" end="17:00:00" repeat="00:03:00"/>
    </job>
    

    Best regards
    Andreas

     

    Last edit: Andreas 2015-10-12

Log in to post a comment.