You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

A simple way to reduce the number of jobs or job-chains is to use a generic job.

  <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/job.xml job ]order="yes"
       stop_on_error="no"
       title="This job is a example showing the generic execution of a shell-script or a shell-command">
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/script.xml script ]language="shell">
          <![CDATA[
  '''echo %SCHEDULER_PARAM_SCRIPT2EXECUTE%'''
  '''%SCHEDULER_PARAM_SCRIPT2EXECUTE%'''
          ]]>
      </script>
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/run_time.xml run_time]/>
  </job>

This job will execute a script or a command which name is specfied with the parameter "Script2Execute".

Putting this job in a chain like the one below

  <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/job_chain.xml job_chain] orders_recoverable="yes"
             visible="yes"
             title="ShellExecutor: generic Execution of a shell-script or a command">
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/job_chain_node.xml job_chain_node] state="Step.100"
                      job="GenericShellExecutor"
                      next_state="success"
                      error_state="error"/>
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/job_chain_node.xml job_chain_node] state="success"/>
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/job_chain_node.xml job_chain_node] state="error"/>
  </job_chain>

will start this job every time an order for the chain is scheduled like this one:

  <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/order.xml order]>
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/params.xml params]>
          <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/param.xml param ]name="Script2Execute"
                 '''value="dir c:\temp"/>'''
      </params>
      <[http://www.sos-berlin.com/doc/en/scheduler.doc/xml/run_time.xml run_time] let_run="no"/>
  </order>

At the end, one have to create for each script/command to execute an additional order.

  • No labels