- Timestamp:
- 02/03/06 16:42:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r7471 r7476 37 37 38 38 user=`whoami` 39 program=checkfile avail39 program=checkfilesavail 40 40 source /home/$user/Mars/datacenter/scripts/sourcefile 41 41 42 42 table=SequenceProcessStatus 43 43 column=fAllFilesAvail 44 date=NULL45 datetime=`date +%F-%H-%M-%S`46 year=`date +%Y`47 44 48 45 todofile=$listpath/ToDo-$table-$column.txt 49 getstatuslogpath=$logpath/getstatus/$program/$year 50 getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log 46 lockfile=$lockpath/lock-$program.txt 51 47 52 scriptlogpath=$logpath/run/ checkfilesavail/`date +%Y/%m/%d`48 scriptlogpath=$logpath/run/$program/`date +%Y/%m/%d` 53 49 makedir $scriptlogpath 54 55 scriptlog=$scriptlogpath/checkfilesforsequenceavail-$datetime.log 50 scriptlog=$scriptlogpath/$program-$datetime.log 56 51 57 52 date >> $scriptlog 2>&1 58 59 makedir $getstatuslogpath >> $scriptlog 2>&160 53 61 54 cd $mars 62 55 63 56 # check if script is already running 64 date > $lock path/lock-$program.txt>> $scriptlog 2>&157 date > $lockfile >> $scriptlog 2>&1 65 58 checklock0=$? 66 59 case $checklock0 in … … 74 67 75 68 # get todo list 76 echo "getting list..." >> $scriptlog 2>&1 77 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` 78 79 case $check0 in 80 1) echo "check0=$check0 -> everything ok -> do step" >> $scriptlog 2>&1 ;; 81 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 82 rm -v $todofile >> $scriptlog 2>&1 83 rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 84 date >> $scriptlog 2>&1 85 exit;; 86 esac 69 getdolist >> $scriptlog 2>&1 87 70 88 71 # retrieve sequences from todofile … … 91 74 then 92 75 echo "nothing to do -> exit" >> $scriptlog 2>&1 93 rm -v $todofile >> $scriptlog 2>&1 94 rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 95 date >> $scriptlog 2>&1 96 exit 76 finish >> $scriptlog 2>&1 97 77 fi 98 78 … … 105 85 var1=$no 106 86 var2=$no2 107 outpath=$logpath/$program/$no 108 echo "outpath: "$outpath >> $scriptlog 2>&1 87 checkfileavailpath=$logpath/$program/$no 109 88 makedir $outpath >> $scriptlog 2>&1 89 checkfileavaillog=$checkfileavailpath/$program-$sequence.log 110 90 111 91 sequencefile=$sequpath/$no/sequence$no2.txt … … 114 94 setstatus "start" >> $scriptlog 2>&1 115 95 116 check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $ outpath/checkfileavail-$sequence.log | grep int | sed -e 's/(int)//'`96 check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $checkfileavaillog | grep int | sed -e 's/(int)//'` 117 97 118 98 case $check1 in … … 128 108 done 129 109 130 rm -v $todofile >> $scriptlog 2>&1 131 rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 110 finish >> $scriptlog 2>&1 132 111 133 date >> $scriptlog 2>&1134
Note:
See TracChangeset
for help on using the changeset viewer.