- Timestamp:
- 01/30/06 17:13:07 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
r7460 r7465 37 37 38 38 user=`whoami` 39 program=checkfileavail 39 40 source /home/$user/Mars/datacenter/scripts/sourcefile 40 41 … … 46 47 47 48 todofile=$listpath/ToDo-$table-$column.txt 48 getstatuslogpath=$logpath/getstatus/ checkfileavail/$year49 getstatuslogpath=$logpath/getstatus/$program/$year 49 50 getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log 50 51 … … 61 62 62 63 # check if script is already running 63 date > $lockpath/lock- checkfileavail.txt >> $scriptlog 2>&164 date > $lockpath/lock-$program.txt >> $scriptlog 2>&1 64 65 checklock0=$? 65 66 case $checklock0 in 66 67 0) echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;; 67 68 1) echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1 68 echo "-> checkfileavailis running -> exit" >> $scriptlog 2>&169 echo "-> $program is running -> exit" >> $scriptlog 2>&1 69 70 date >> $scriptlog 2>&1 70 71 exit;; … … 80 81 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 81 82 rm -v $todofile >> $scriptlog 2>&1 82 rm -v $lockpath/lock- checkfileavail.txt >> $scriptlog 2>&183 rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 83 84 date >> $scriptlog 2>&1 84 85 exit;; … … 91 92 echo "nothing to do -> exit" >> $scriptlog 2>&1 92 93 rm -v $todofile >> $scriptlog 2>&1 93 rm -v $lockpath/lock- checkfileavail.txt >> $scriptlog 2>&194 rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 94 95 date >> $scriptlog 2>&1 95 96 exit … … 102 103 no=`printf %08d $sequence | cut -c 0-4` 103 104 no2=`printf %08d $sequence` 104 outpath=$logpath/ checkfileavail/$no105 outpath=$logpath/$program/$no 105 106 echo "outpath: "$outpath >> $scriptlog 2>&1 106 107 makedir $outpath >> $scriptlog 2>&1 … … 112 113 case $check1 in 113 114 1) echo "check1=$check1 -> everything ok -> setting status..." >> $scriptlog 2>&1 114 setstatuslogpath=$logpath/setstatus/checkfileavail/$no 115 makedir $setstatuslogpath >> $scriptlog 2>&1 116 117 check2=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"Now()\""\) | tee $setstatuslogpath/setstatus-checkfileavail-$sequence.log | grep int | sed -e 's/(int)//'` 118 case $check2 in 119 1) echo "check2=$check2 -> everything ok, status has been set" >> $scriptlog 2>&1 ;; 120 *) echo "check2=$check2 -> ERROR -> step could not be set" >> $scriptlog 2>&1 ;; 121 esac 115 statustime="Now()" 116 failed="NULL" 117 starttime="NULL" 118 failedtime="NULL" 119 var1=$no 120 var2=$sequence 121 setstatus 122 122 ;; 123 123 *) echo "check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;; … … 126 126 127 127 rm -v $todofile >> $scriptlog 2>&1 128 rm -v $lockpath/lock- checkfileavail.txt >> $scriptlog 2>&1128 rm -v $lockpath/lock-$program.txt >> $scriptlog 2>&1 129 129 130 130 date >> $scriptlog 2>&1
Note:
See TracChangeset
for help on using the changeset viewer.