TORQUE supports per job prologue and epilogue scripts when using the qsub -l option. The syntax is:
qsub -l prologue=<prologue_script_path> epilogue=<epilogue_script_path> <script>.
The path can be either relative (from the directory where the job is submitted) or absolute. The files must be owned by the user with at least execute and read privileges, and the permissions must not be writeable by group or other.
/home/usertom/dev/
-r-x------ 1 usertom usertom 24 2009-11-09 16:11 prologue_script.sh
-r-x------ 1 usertom usertom 24 2009-11-09 16:11 epilogue_script.sh
Example G-1:
$ qsub -l prologue=/home/usertom/dev/prologue_script.sh,epilogue=/home/usertom/dev/epilogue_script.sh job14.pl
This job submission executes the prologue script first. When the prologue script is complete, job14.pl runs. When job14.pl completes, the epilogue script is executed.
Related topics