#! /bin/tcsh -f echo $$ $0 $* # Print pid, script name, input args. #look for any other processes with the same name and exit if you find them #(we don't want multiple copies of the same script) ps -fN -p $$ | grep $USER | grep $0 | grep -v grep && exit 5 #setup the software source ~cdfsoft/cdf2.cshrc setup cdfsoft2 4.11.2 set aaaaa_oracle_dir = `echo $ORACLE_CLIENT_DIR` echo $ORACLE_CLIENT_DIR #setup cdfdb #echo $ORACLE_CLIENT_DIR rm problem_runs.lst touch problem_runs.lst #is the database working? if not exit with no output #dbPing -dcdfonprd -s > /dev/null || exit 6 sqlplus -s cdf_reader/reader@cdfonprd @get_some_runs_by_process_name.sql PROD_PHYSICS_CDF 184290 185000 #move to the right place cd /data1/cdfcalib/cron_scripts/fill_passtable/ foreach run(`grep . runs.lst`) echo "run = $run" rm tof_cid_changes.out @ tof_jobset = `sqlplus -s cdf_reader/reader@cdfonprd @get_max_jobset.sql $run PROD_PHYSICS_TOF` ./compare_tableids_jobset_onerun.tcsh $tof_jobset $run PROD_PHYSICS_CDF 1 >& tof_cid_changes.out echo "tof_jobset = $tof_jobset" if(! -z tof_cid_changes.out)then echo "found tof_cid_changes" cat tof_cid_changes.out endif @ num = `grep -c TOFOFFLINEA tof_cid_changes.out` echo "num = $num" #counting the number of SI tables in the compare_tableids_jobset_onerun.tcsh output. If there are tables present it #means differences have been found - script exits if ( `grep -c TOFOFFLINEA tof_cid_changes.out` || `grep -c TOFPEDLOOKUP tof_cid_changes.out` || `grep -c TOFTACPARM tof_cid_changes.out`) then echo "run $run has problem TOF tables" echo $run >> problem_runs.lst endif end #foreach run(`grep . runs.lst`) echo "out",$0