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

Sometimes it is neccessary to get the PID of the actual currently running task (job). The programm program getParentId is made provided for this. You can download the program here: www.sos-berlin.com/download/getParentId.zip

Please unzip to any location. You will find the exe file getParentId.exe. Executing this exe file results in the PID being logged to STDOUTstdout. Here is an example job that set sets an environment variable PID with the pid.

This program is presently working on 32 bit systems only.

Code Block

 <job  name="job7">
     <script  language="shell">
        <![CDATA[
 c:\temp\getParentId > 1.pid
 set /p PID=<1.pid
 del 1.pid
 echo pid= %PID%
         ]]>
     </script>
 
     <run_time />
 </job>

A good idea is to put this code snippet into a file, e.g. getpid.cmd, which that can than be included in any shell - job by using the include- function of JobScheduler.