Skip to end of metadata
Go to start of metadata

 

Some shell scripts must run in a specific working directory. To achieve this, you can add a cd command to the working directory before executing the shell script.

The default working folder ($SCHEDULER_DATA) is the one containing the 'config', 'jobs', etc. folders, so on a Win-7 installation with default settings, this is:

  C:\ProgramData\sos-berlin.com\jobscheduler\scheduler-id\

where 'scheduler-id' is the ID of the JobScheduler.

 <job  task="5" stop_on_error="no" order="yes" warn_if_longer_than="30:00" name="job1">
    <script  language="shell">
        <![CDATA[
 cd c:\temp
 c:\script\myscript.cmd
         ]]>
    </script>
 </job>

It is also possible to configure this as an extra file with just the cd command and add this file to the script with an include. This is helpful when you attempt to move a job from test to production without changing the configuration but with another working directory on the production site.

<job  tasks="5" stop_on_error="no" order="yes" warn_if_longer_than="30:00" name="job1">
   <script  language="shell">
       <include  live_file="set_working_direcory.cmd"/>
       <![CDATA[
c:\script\myscript.cmd
       ]]>
   </script>
</job>

see also: