Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /job_submission_condor/scripts/timeout_review_and_remove.sh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #!/bin/bash
0002 
0003 n=1
0004 N=$(condor_q -constraint 'RemoteUserCpu>60000 && JobStatus==2' -af ClusterID ProcID | wc -l)
0005 
0006 condor_q -constraint 'RemoteUserCpu>60000 && JobStatus==2' -af RemoteUserCpu ClusterID ProcID RemoteHost | sort -nr | head -n 20
0007 condor_q -constraint 'RemoteUserCpu>60000 && JobStatus==2' -af RemoteUserCpu ClusterID ProcID RemoteHost | sort -nr | while read RemoteUserCpu ClusterID ProcID RemoteHost ; do
0008   echo "Job ${ClusterID}.${ProcID} ($n/$N), $RemoteUserCpu seconds"
0009   condor_q ${ClusterID}.${ProcID}
0010   prefix="LOG/CONDOR/osg_${ClusterID}_${ProcID}"
0011 
0012   ls -al ${prefix}.*
0013   condor_q ${ClusterID}.${ProcID} -af LastRemoteHost
0014   condor_q ${ClusterID}.${ProcID} -af RemoteHost
0015   test -f ${prefix}.log && tail -n 10 ${prefix}.log
0016 
0017   review=x
0018   while [ -n "${review}" ] ; do
0019     read -n 1 -p "Job ${ClusterID}.${ProcID} ($n/$N): review? [e,l,o] " review <&1
0020     echo
0021     if [ "${review}" == "l" ] ; then
0022       less ${prefix}.log
0023     fi
0024     if [ "${review}" == "e" ] ; then
0025       condor_tail -stderr ${ClusterID}.${ProcID}
0026     fi
0027     if [ "${review}" == "o" ] ; then
0028       condor_tail ${ClusterID}.${ProcID}
0029     fi
0030   done
0031 
0032   remove=x
0033   read -n 1 -p "Job ${ClusterID}.${ProcID} ($n/$N): hold? [h,r] " remove <&1
0034   echo
0035   if [ "${remove}" == "h" ] ; then
0036     condor_hold ${ClusterID}.${ProcID}
0037   fi
0038   if [ "${remove}" == "r" ] ; then
0039     condor_rm ${ClusterID}.${ProcID}
0040   fi
0041 
0042   n=$((n+1))
0043 done