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

Question:

How can a job, which is only to run once, be started immediately and not be restarted the next time JobScheduler is restarted?

Answer:

The following script will start a job immediately and ensure that it will not be restarted:

Code Block
languagehtml/xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job  title="run once job example" stop_on_error="no" order="no">
    <script  language="shell">
        <![CDATA[
 echo run once
        ]]>
    </script>
    <monitor  name="DeleteObjectFileAfterExecution" ordering="99">
        <script  language="javax.script:rhino">
            <![CDATA[
 function spooler_task_after() \{
    spooler_job.remove();
 \}
            ]]>
        </script>
    </monitor>
    <run_time  once="yes"/>
 </job>

...

This solution means that it is no necessary to use a timestamp as a workaround.