Skip to content
Snippets Groups Projects
Commit 7b033389 authored by William (Bill) E. Allcock's avatar William (Bill) E. Allcock
Browse files

WIP: This is a hook for doing cleanup during the prologue and epilogue. It...

WIP: This is a hook for doing cleanup during the prologue and epilogue.  It executes a shell script roughly equivalent to the epilogue and prologue on Cooley
parent 042761f7
No related branches found
No related tags found
No related merge requests found
#
# Do basic cleanup tasks during the prologue and epilogue
# TODO: Figure out where the shell scripts are going to live.
#
import pbs
import subprocess
try:
e = pbs.event()
j = e.job
jobid = str(j.jobid)
username = str(j.euser)
if e.type == pbs.EXECJOB_PROLOGUE:
op = "-p"
elif e.type == pbs.EXECJOB_EPILOGUE:
op = "-e"
else:
op = "UNKNOWN"
tool = "clean-node.sh"
subprocess.run([tool, op, jobid, username], timeout = 10, shell = False)
e.accept()
except Exception as ex:
e.reject(f"hook_job_cleanup.py threw an exception on jobid {jobid} for user {username}: {ex}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment