#! /bin/csh -f # Script for submitting,canceling and checking on LoBoS jobs # 072197 EMB Initial version # 101097 EMB Added cancel and list # 121597 EMB If HPUX remove the /tmp_mnt # 030398 EMB Added check for master node availability and # HPUX ping command differences # 051998 EMB Added chmod so script can be executed # set hosts = ( master1.lobos.nih.gov master2.lobos.nih.gov ) # switch ($1) # case "sub": # Capture the job stream set fname = `whoami`.`date "+%y%m%d%H%M%S"` set pwd = `pwd` # Check for HPUX and /tmp_mnt in PWD if (`/bin/uname` == "HP-UX") then if ($pwd =~ *tmp_mnt* ) then set pwd = `echo $pwd | sed -e 's/\/tmp_mnt//'` endif set fore = "" set aft = " 64 1 " else set fore = " -c 1 " set aft = "" endif echo "#Q PWD = $pwd" > $fname cat >> $fname chmod 755 $fname foreach host ($hosts) if (`ping $fore $host $aft | grep -c ' 0% packet loss'`) then rcp $fname $host':/lobos/jobs' else echo Warning $host is unavailable, check queue to be sure job is submitted endif end breaksw # case "can": if ($2 == "") then echo "Enter the job file name" set filename = $< else set filename = $2 endif if (-e $filename != 1) echo "Warning:Job file not found" set fname = $filename.done touch $fname if (`/bin/uname` == "HP-UX") then set fore = "" set aft = " 64 1 " else set fore = " -c 1 " set aft = "" endif foreach host ($hosts) if (`ping $fore $host $aft | grep -c ' 0% packet loss'`) then rcp $fname $host':/lobos/jobs' else echo Warning $host is unavailable, check queue to be sure job is cancelled endif end rm $fname breaksw # case "list": set fname = xxx`date "+%y%m%d%H%M%S"` if (`/bin/uname` == "HP-UX") then set fore = "" set aft = " 64 1 " else set fore = " -c 1 " set aft = "" endif foreach host ($hosts) if (`ping $fore $host $aft | grep -c ' 0% packet loss'`) then rcp $host':/lobos/job_status' $fname else echo Warning $host is unavailable endif end cat $fname rm $fname breaksw # default: echo "Usage: lobosq sub <^D> or < input_file " echo " can jobname " echo " list " # endsw # # Tickle the lobosqd daemon # exit #