Listing 2. PBS Job Epilogue Script

#!/bin/csh
#
# /var/spool/pbs/mom_priv/epilogue -- Clear out TMPDIR
#
# epilogue gets 9 arguments:
# 1 -- jobid
# 2 -- userid
# 3 -- grpid
# 4 -- job name
# 5 -- sessionid
# 6 -- resource limits
# 7 -- resources used
# 8 -- queue
# 9 -- account
setenv TMPDIR /tmp/pbstmp.$1
foreach node ( `cat /var/spool/pbs/aux/$1 | uniq` )
  rsh $node /bin/rm -rf $TMPDIR
end