#!/bin/bash -f
# set -x
# 
#  Cancel job running in PBS.
# 

echo "----- starting cancel_pbs_job -----" 1>&2

joboption_lrms=pbs

. ${NORDUGRID_LOCATION}/libexec/cancel_common.sh $1

##############################################################
# These should be set automatically
##############################################################
# Path to pbs commands
PBS_BIN_PATH=${PBS_BIN_PATH:-/usr/bin}


PBS_QDEL='qdel'
if [ ! -z "$PBS_BIN_PATH" ] ; then
  PBS_QDEL="${PBS_BIN_PATH}/${PBS_QDEL}"
fi

tmpdir=${TMP_DIR:-/tmp}

echo executing qdel with job id $joboption_jobid 1>&2
"${PBS_QDEL}" "${joboption_jobid}"

echo "----- exiting cancel_pbs_job -----" 1>&2
echo "" 1>&2
exit 0







