Changeset 7944 for trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
- Timestamp:
- 08/25/06 22:09:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
r7938 r7944 32 32 # 33 33 34 source `dirname $0`/sourcefile 35 printprocesslog "INFO starting $0" 34 36 program=insertdatasets 35 source `dirname $0`/sourcefile36 37 37 38 set -C 38 39 39 cd $mars 40 41 datetime=`date +%F-%H-%M-%S` 42 lockfile=$lockpath/lock-insertdatasets.txt 43 44 scriptlogpath=$runlogpath/$program 45 makedir $scriptlogpath 46 47 scriptlog=$scriptlogpath/insertdatasets-$datetime.log 48 40 scriptlog=$runlogpath/$program-$datetime.log 49 41 date >> $scriptlog 2>&1 50 42 51 43 # check if script is already running 44 lockfile=$lockpath/lock-$program.txt 52 45 checklock >> $scriptlog 2>&1 53 46 … … 57 50 echo "" >> $scriptlog 2>&1 58 51 52 cd $mars 53 59 54 # extract information from dataset file and insert it into db with the macro insertdataset.C 55 printprocesslog "INFO inserting dataset information into db" 60 56 for datasetfile in ${datasetfiles[@]} 61 57 do … … 74 70 echo "number in filename and in file are not the same " >> $scriptlog 2>&1 75 71 echo " -> continue with next dataset" >> $scriptlog 2>&1 72 printprocesslog "ERROR number in filename and file are not the same for dataset $no2" 76 73 continue 77 74 fi … … 98 95 insertdatasetlog=$insertdatasetpath/insertdataset-$no3.log 99 96 97 printprocesslog "INFO inserting dataset $no2" 100 98 # insert information into db 101 99 check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'` 102 100 case $check0 in 103 1) echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 ;; 104 *) echo "check0=$check0 -> ERROR " >> $scriptlog 2>&1 ;; 101 1) echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1 102 printprocesslog "INFO dataset $no2 successfully inserted" 103 ;; 104 0) echo " check1=$check1 -> no connection to db -> continue..." >> $scriptlog 2>&1 105 printprocesslog "WARN connection to DB failed" 106 check="no" 107 ;; 108 *) echo " check0=$check0 -> ERROR " >> $scriptlog 2>&1 109 printprocesslog "ERROR $program.C failed for dataset $no2" 110 ;; 105 111 esac 106 112 done 107 113 108 rm -v $lockfile >> $scriptlog 2>&1 114 finish >> $scriptlog 2>&1 109 115 110 set +C111 112 date >> $scriptlog 2>&1113
Note:
See TracChangeset
for help on using the changeset viewer.