Hook for job termination on non execution-host

Looking at - https://www.pbsworks.com/pdfs/PBSHooks14.2.pdf - I’m wondering what’s the best way to run a hook after a job is complete?

I’m using execjob_end, but this lifecycle is executed on all execution hosts. To make sure I only execute it once, I have written a simple function which check if the current host is the first one on the j.exec_vnode(), but now I do have some dependencies on other hooks which should be executed after a job complete and can NOT be executed on my mom_hosts.

Any ideas?

You can have multiple execjob_end hooks and then you can set the hook order on these execjob_end hooks
qmgr -c “set hook execjob_end_hook1 order=20”
qmgr -c “set hook execjob_end_hook2 order=21”
qmgr -c “set hook execjob_end_hook3 order=22”

In this way, you can manage what goes on in each hook.