source: BAORadio/AmasNancay/trunk/statusgain.sh @ 579

Last change on this file since 579 was 579, checked in by torrento, 13 years ago

version adaptee a grid engin (ana)

File size: 1.3 KB
Line 
1#!/bin/sh
2#liste des "sources" enregistrees sous Amas
3GREP=/bin/grep
4AWK=/bin/awk
5ECHO=/bin/echo
6MKDIR=/bin/mkdir
7CAT=/bin/cat
8PRINTF=/usr/bin/printf
9RM=/bin/rm
10SORT=/bin/sort
11XARGS=/usr/bin/xargs
12WC=/usr/bin/wc
13DefaultIFS=$' \t\n'
14IFS=$DefaultIFS
15
16# Irods environment settings
17. /usr/local/shared/bin/irods_env.sh -noverbose
18
19scriptName="`basename $0`"
20$ECHO "Processing script ${scriptName} at `date`"
21
22#Path to public backupable path
23publicpath="/afs/in2p3.fr/home/c/campagne/public"
24
25#Path where the job will do temporary IO
26. ${SCRIPTPATH}/set_iojobpath.sh
27iojobpath=$(set_iojobpath)
28cd ${iojobpath}
29
30
31OUT1=./baoils.$$
32ils /baoradio/data/AmasNancay/ > ${OUT1}
33OUT2=./baoawk1.$$
34$AWK '($1=="C-") {print $2}' ${OUT1} > ${OUT2}
35$RM $OUT1
36#Sequence
37tableau=( `$CAT $OUT2 | $AWK '{print $1}'` )
38IFS='
39'
40tableau=( $( $PRINTF "%s\n" "${tableau[@]}" | $AWK 'x[$0]++ == 0' ) )
41IFS=$DefaultIFS
42
43$RM $OUT2
44
45for i in ${tableau[@]}
46do
47  $ECHO "source $i"
48  listedate=( `ils $i | $AWK '($1=="C-"){print $2}'`)
49  IFS='
50'
51  listedate=( $( $PRINTF "%s\n" "${listedate[@]}" | $AWK 'x[$0]++ == 0' ) )
52  IFS=$DefaultIFS
53
54  for j in ${listedate[@]}
55  do
56    gainOk=`ils ${j} | $GREP -i "gain_" | $WC -l`
57    if [ ${gainOk} -gt 0 ]; then
58        $ECHO ">>> $j ---> GAIN Done (${gainOk})"
59    else
60        $ECHO ">>> $j ---> GAIN To be computed"
61    fi
62  done 
63done
Note: See TracBrowser for help on using the repository browser.