- Timestamp:
- 01/10/06 22:12:58 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r7426 r7460 20 20 # Author(s): Daniela Dorner 08/2004 <mailto:dorner@astro.uni-wuerzburg.de> 21 21 # 22 # Copyright: MAGIC Software Development, 2000-200 422 # Copyright: MAGIC Software Development, 2000-2006 23 23 # 24 24 # 25 25 # ======================================================================== 26 26 # 27 # This script launches the checking of the availability of the files for 28 # the sequences. 29 # 30 # After checking, if the script is already running, the todolist is 31 # written by using the macro getdolist.C 32 # Then for each sequence the availability of the files (raw, cc, caco) is 33 # checked by using the macro checkfilesavail.C 34 # If this was successful, the status is inserted into the database using 35 # the macro setstatus.C 27 36 # 28 37 … … 51 60 cd $mars 52 61 53 if [ -e $todofile ] 54 then 55 echo "checkfilesforsequenceavail is already running -> exit" >> $scriptlog 2>&1 56 exit 57 fi 62 # check if script is already running 63 date > $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1 64 checklock0=$? 65 case $checklock0 in 66 0) echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;; 67 1) echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1 68 echo "-> checkfileavail is running -> exit" >> $scriptlog 2>&1 69 date >> $scriptlog 2>&1 70 exit;; 71 *) echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;; 72 esac 58 73 74 # get todo list 59 75 echo "getting list..." >> $scriptlog 2>&1 60 76 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` … … 62 78 case $check0 in 63 79 1) echo "check0=$check0 -> everything ok -> do step" >> $scriptlog 2>&1 ;; 64 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;; 80 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 81 rm -v $todofile >> $scriptlog 2>&1 82 rm -v $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1 83 date >> $scriptlog 2>&1 84 exit;; 65 85 esac 66 86 87 # retrieve sequences from todofile 67 88 sequences=(`cat $todofile`) 68 69 89 if [ "$sequences" = "" ] 70 90 then 71 91 echo "nothing to do -> exit" >> $scriptlog 2>&1 72 92 rm -v $todofile >> $scriptlog 2>&1 73 rm -v $lockpath/lock- $table-$column.txt >> $scriptlog 2>&193 rm -v $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1 74 94 date >> $scriptlog 2>&1 75 95 exit … … 77 97 78 98 echo "sequences: "${sequences[@]} >> $scriptlog 2>&1 79 80 99 for sequence in ${sequences[@]} 81 100 do … … 107 126 108 127 rm -v $todofile >> $scriptlog 2>&1 109 rm -v $lockpath/lock- $table-$column.txt >> $scriptlog 2>&1128 rm -v $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1 110 129 111 130 date >> $scriptlog 2>&1
Note:
See TracChangeset
for help on using the changeset viewer.