How to create a custom epilogue script for certain jobs only?

I understand that epilogue will run some commands after any job finishes. What I want is an epilogue for only certain jobs and that epilogue is different for each of the jobs.

Specifically I want certain commands to be run after a job is killed due to wall time.

The generic $PBS_HOME/mom_priv/epilogue is replaced using execjob_epilogue hook.
Also you have execjob_end hook. Based on what attribute values are available for these these hook events , you can implement your own logic to identify the job and decide to execute or not.

1 Like

Thanks. I think the hooks option may be too complicated for me . I only need the custom epilogue for jobs that get assigned to one particular node. So on that node I made this epilogue script which seems to work ok:

[127]root@lustwz17:.../spool/pbs/mom_priv# pwd
/var/spool/pbs/mom_priv
[0]root@lustwz17:.../spool/pbs/mom_priv# cat epilogue
#!/bin/bash
echo "From the epilogue script" > /tmp/$1_epilogue.txt
echo $@  >> /tmp/$1_epilogue.txt

sudo -u catmap bash -c 'source ~/.bashrc;stop fluentIN;'


[0]root@lustwz17:.../spool/pbs/mom_priv#

1 Like