I need a help to write a hook. I would like to delete a job if job’s path is something like /home/username, eg.
I have read the PBS hooks guide, but I’am in dought on how to do it.
I think that I need a pre-execution hook like this:
create hook deny_home
import hook deny_home application/x-python default /hooks/deny_home_script.py
set hook deny_home event = queuejob
set hook deny_home order = 2
set hook deny_home alarm = 60
and the python script content is:
e = pbs.event()
j = e.job
if '/home' in j.Submit_arguments: e.reject("Performing tasks in home directory is not allowed")
e.reject(“Performing tasks in home directory is not allowed”)
Is it right?