ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/CrabScript/status
Revision: 1.1.1.2 (vendor branch)
Committed: Mon Feb 25 15:54:04 2008 UTC (17 years, 2 months ago) by auterman
Branch: tex, Demo, SusyScan
CVS Tags: start
Changes since 1.1.1.1: +5 -5 lines
Log Message:
PAT Jet Analyzer

File Contents

# Content
1 #!/bin/bash
2
3 DONE=0
4 RUN=0
5 ABORT=0
6 SCHED=0
7 TOT=0
8 I=0
9 UNK=0
10
11 touch resubmit
12 NJOBS=`ls -d crab_* | wc -l`
13 JOBS=`ls -d crab_*`
14 for JOB in $JOBS
15 do
16 #echo $JOB
17 rm -f crap.tmp
18 crab -status -continue $JOB > crap.tmp
19 _DONE=`grep " Done (Success)" crap.tmp | wc -l`
20 _RUN=`grep " Running " crap.tmp | wc -l`
21 _ABORT=`grep " Aborted " crap.tmp | wc -l`
22 _SCHED=`grep " Scheduled " crap.tmp | wc -l`
23 _TOT=`grep "Total Jobs" crap.tmp | cut -b 10-12`
24 #_UNK=$(($_TOT-$_DONE-$_RUN-$_ABORT-$_SCHED))
25 ABORTEDJOBS=`grep -A 1 "Jobs aborted" crap.tmp | grep "List of jobs" | cut -b 24-`
26 if [ "$ABORTEDJOBS" != '' ]
27 then
28 echo "crab -resubmit $ABORTEDJOBS -continue $JOB" >> resubmit
29 fi
30 #
31 DONE=$(($DONE+$_DONE))
32 RUN=$(($RUN+$_RUN))
33 ABORT=$(($ABORT+$_ABORT))
34 SCHED=$(($SCHED+$_SCHED))
35 #TOT=$(($TOT+$_TOT))
36 #UNK=$(($TOT-$DONE-$RUN-$ABORT-$SCHED))
37 I=$(($I+1))
38 #
39 echo "Checked $I (of $NJOBS) directories:"
40 echo " current dir: $JOB"
41 echo "-> $_DONE ($DONE) Done (Success)"
42 echo "-> $_RUN ($RUN) Running"
43 echo "-> $_ABORT ($ABORT) Aborted"
44 echo "-> $_SCHED ($SCHED) Scheduled"
45 #echo "-> $_UNK ($UNK) Unknown status"
46 echo "-> $_TOT ($TOT) Total jobs"
47 echo
48 done