Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
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 | ||
---|---|---|
| ||
<?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.