(file) Return to watchgates.csh CVS log (file) (dir) Up to [Development] / JSOC / proj / workflow

 1 phil  1.1 #! /bin/csh -f
 2           # monitor program
 3           
 4           set keep_watching = 1
 5           set thiscmd = `basename $0`
 6           if ($thiscmd == checkgates.csh) set keep_watching = 0
 7           
 8           if ($#argv >= 1) then
 9                set LIST = "*"$1"*"
10           else
11                set LIST = "*"
12           endif
13           # echo "$LIST"
14           
15           if ($?WORKFLOW_ROOT) then
16             set WFDIR = $WORKFLOW_DATA
17             set WFCODE = $WORKFLOW_ROOT
18           else
19             echo Need WORKFLOW_ROOT variable to be set.
20             exit 1
21           endif
22 phil  1.1 
23           set nonomatch
24           
25           
26           while (1)
27           
28              cd $WFDIR
29           
30              while (-e GATEKEEPERBUSY)
31                 echo -n '.'
32                 sleep 1
33              end
34           
35              clear
36              set nowtxt = `date -u +%Y.%m.%d_%H:%M:%S`"_UTC" 
37              echo " "; echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
38              echo " "; echo " "; echo " "; echo " "
39              echo -n "TIME = $nowtxt, LAST_NEWICKET = "
40              cat LAST_NEWTICKET
41           
42              cd $WFDIR/gates
43 phil  1.1    foreach gate ( $LIST )
44                   echo " "
45                   cd $WFDIR/gates/$gate
46                   set gatestatus = `cat gatestatus`
47                   if ($gatestatus == "HOLD") then
48                       echo -n "GATE $gate is on HOLD, skip"
49                       cd ..
50                       continue
51                   endif
52                   echo -n "GATE $gate" "   for "
53                   cat product
54                   set SEQUENCE = `cat sequence_number`
55                   set NEXTUPDATE = `cat nextupdate`
56                   set LOW = `cat low`
57                   set HIGH = `cat high`
58                   echo  "     Last ticketID =  $SEQUENCE,   nextupdate =  $NEXTUPDATE", low = $LOW, high = $HIGH
59                   echo -n "     NEW TICKETS: "
60                   cd new_tickets
61                   set ticketlist = `/bin/ls`
62                   set ntickets = $#ticketlist
63                   if ($ntickets) then
64 phil  1.1     	      foreach ticket ($ticketlist)
65                             echo -n "$ticket "
66               	      end  #new
67                   endif
68                   echo  " "
69                   cd ../active_tickets
70                   echo "     ACTIVE TICKETS: "
71                   set ticketlist = `/bin/ls`
72                   set ntickets = $#ticketlist
73                   if ($ntickets) then
74                         foreach ticket ($ticketlist)
75                              set STATUS = `grep STATUS $ticket`
76               		   set WANTLOW = `grep WANTLOW $ticket`
77               		   set WANTHIGH = `grep WANTHIGH $ticket`
78               		   set ACTION = `grep ACTION $ticket`
79                              set TASKID = `grep TASKID $ticket`
80                              echo "         $ticket"": $STATUS, $WANTLOW, $WANTHIGH, $ACTION, $TASKID"
81               	      end # active
82                   endif
83                   cd ..
84              end
85 phil  1.1    if ($keep_watching) then
86 phil  1.3        sleep 15 
87 phil  1.1    else
88                  break
89              endif
90           end

Karen Tian
Powered by
ViewCVS 0.9.4