 | This is a script to keep track of the Seti client and log the time, results, and info for each WU. It stores the log in a file called setitimes.log, in a format very similar to that used by Seti Spy. The attached tarfile includes the executable calcflop, which is used by the script to calculate the teraflops performed while analysing the WU. To use it, untar the file in the seti directory, and use the command "./wutimes.log". The output can be piped to another file.
The script can also be found here.
#!/bin/sh user_name=`grep name user_info.sah | cut -d= -f2 | cut -dy -f1` user_results=`grep results user_info.sah | cut -d= -f2` display_pct=`grep prog state.sah | cut -d= -f2` wu_name=`grep name work_unit.sah | cut -d= -f2` wu_angle=`grep angle work_unit.sah | cut -d= -f2` wu_date=`grep record work_unit.sah | cut -d= -f2 | cut -d'(' -f2 | cut -d')' -f1` st_ra=`grep start_ra work_unit.sah | cut -d= -f2` st_dec=`grep start_dec work_unit.sah | cut -d= -f2` echo '' echo 'Account Name: '$user_name echo 'Results Sent: '$user_results echo '' echo 'Work Unit Angle: '$wu_angle echo 'Work Unit Date: '$wu_date echo 'Work Unit Name: '$wu_name echo '' echo 'Percent of present WU completed: '$display_pct echo '' calc_pct=`grep prog state.sah | cut -d. -f2 | cut -c1-6` c2=`expr $calc_pct - 5` if [ -f setitimes.log ] then echo 'Using existing file setitimes.log' echo ' ' else echo ' Date Time WU Name Date Time Start Start Angle Tera- Process Ret Best Ret Best Ret Best Ret Best'>setitimes.log echo ' Done Done Recorded Recorded RA Dec Range flops Time(h)Spikes Spike Gauss Gauss Trip Trip Pulses Pulse'>>setitimes.log echo 'Log file setitimes.log created' echo ' ' fi rp=`grep -c pulse outfile.sah` rg=`grep -c gauss outfile.sah` rt=`grep -c trip outfile.sah` rs=`grep -c spike outfile.sah` bp=`grep bp_score state.sah | cut -d= -f2` bg=`grep bg_score state.sah | cut -d= -f2` bt=`grep bt_score state.sah | cut -d= -f2` bs=`grep bs_score state.sah | cut -d= -f2` echo 'rp= '$rp > out.dat echo 'bp= '$bp >> out.dat echo 'rg= '$rg >> out.dat echo 'bg= '$bg >> out.dat echo 'rt= '$rt >> out.dat echo 'bt= '$bt >> out.dat echo 'rs= '$rp >> out.dat echo 'bs= '$bs >> out.dat while [ $c2 -ne $calc_pct ] do while [ $c2 -ne $calc_pct ] do if [ outfile.sah -nt out.dat ] then rp=`grep -c pulse outfile.sah` rg=`grep -c gauss outfile.sah` rt=`grep -c trip outfile.sah` rs=`grep -c spike outfile.sah` bp=`grep bp_score state.sah | cut -d= -f2` bg=`grep bg_score state.sah | cut -d= -f2` bt=`grep bt_score state.sah | cut -d= -f2` bs=`grep bs_score state.sah | cut -d= -f2` echo 'rp= '$rp > out.dat echo 'bp= '$bp >> out.dat echo 'rg= '$rg >> out.dat echo 'bg= '$bg >> out.dat echo 'rt= '$rt >> out.dat echo 'bt= '$bt >> out.dat echo 'rs= '$rp >> out.dat echo 'bs= '$bs >> out.dat fi if [ $calc_pct -gt 970000 ] then while [ $calc_pct -gt 970000 ] do calc_sec=`grep cpu state.sah | cut -d. -f1 | cut -d= -f2` if [ outfile.sah -nt out.dat ] then rp=`grep -c pulse outfile.sah` rg=`grep -c gauss outfile.sah` rt=`grep -c trip outfile.sah` rs=`grep -c spike outfile.sah` bp=`grep bp_score state.sah | cut -d= -f2` bg=`grep bg_score state.sah | cut -d= -f2` bt=`grep bt_score state.sah | cut -d= -f2` bs=`grep bs_score state.sah | cut -d= -f2` echo 'rp= '$rp > out.dat echo 'bp= '$bp >> out.dat echo 'rg= '$rg >> out.dat echo 'bg= '$bg >> out.dat echo 'rt= '$rt >> out.dat echo 'bt= '$bt >> out.dat echo 'rs= '$rp >> out.dat echo 'bs= '$bs >> out.dat fi sleep 5 if [ -s state.sah ] then calc_pct=`grep prog state.sah | cut -d. -f2 | cut -c1-6` else calc_pct=0 fi done datime=`date '+%D %T'` echo 'Done work unit at '$datime hour_c=` expr $calc_sec / 3600` min_c=` expr $calc_sec % 3600` min_c=` expr $min_c \* 100` min_c=` expr $min_c / 36` tflops=`./calcflop $wu_angle |cut -d= -f2` rp=`grep rp out.dat | cut -d= -f2` rg=`grep rg out.dat | cut -d= -f2` rt=`grep rt out.dat | cut -d= -f2` rs=`grep rs out.dat | cut -d= -f2` bp=`grep bp out.dat | cut -d= -f2` bg=`grep bg out.dat | cut -d= -f2` bt=`grep bt out.dat | cut -d= -f2` bs=`grep bs out.dat | cut -d= -f2` wu_date=`date -d "$wu_date" '+%D %T'` if [ $min_c -gt 999 ] then echo $datime' '$wu_name' '$wu_date' '$wu_time' '$st_ra' '$st_dec' '$wu_angle' '$tflops' '$hour_c'.'$min_c' '$rs' '$bs' '$rg' '$bg' '$rt' '$bt' '$rp' '$bp >> setitimes.log else if [ $min_c -gt 99 ] then echo $datime' '$wu_name' '$wu_date' '$wu_time' '$st_ra' '$st_dec' '$wu_angle' '$tflops' '$hour_c'.0'$min_c' '$rs' '$bs' '$rg' '$bg' '$rt' '$bt' '$rp' '$bp >> setitimes.log else if [ $min_c -gt 9 ] then echo $datime' '$wu_name' '$wu_date' '$wu_time' '$st_ra' '$st_dec' '$wu_angle' '$tflops' '$hour_c'.00'$min_c' '$rs' '$bs' '$rg' '$bg' '$rt' '$bt' '$rp' '$bp>> setitimes.log else echo $datime' '$wu_name' '$wu_date' '$wu_time' '$st_ra' '$st_dec' '$wu_angle' '$tflops' '$hour_c'.000'$min_c' '$rs' '$bs' '$rg' '$bg' '$rt' '$bt' '$rp' '$bp>>setitimes.log fi fi fi user_results2=`grep results user_info.sah | cut -d= -f2` while [ $user_results2 -eq $user_results ] do sleep 60 user_results2=`grep results user_info.sah | cut -d= -f2` done user_results=$user_results2 echo 'Results Sent: '$user_results sleep 120 while [ ! -f work_unit.sah ] do echo 'Waiting for another work unit...' sleep 120 done wu_name=`grep name work_unit.sah | cut -d= -f2` wu_angle=`grep angle work_unit.sah | cut -d= -f2` wu_date=`grep record work_unit.sah | cut -d= -f2 | cut -d'(' -f2 | cut -d')' -f1` st_ra=`grep start_ra work_unit.sah | cut -d= -f2` st_dec=`grep start_dec work_unit.sah | cut -d= -f2` echo 'New work unit retrieved' echo 'Work Unit Angle: '$wu_angle echo 'Work Unit Date: '$wu_date echo 'Work Unit Name: '$wu_name echo '' else sleep 90 c2=$calc_pct fi calc_pct=`grep prog state.sah | cut -d. -f2 | cut -c1-6` done sleep 300 calc_pct=`grep prog state.sah | cut -d. -f2 | cut -c1-6` done echo 'Client stopped. Exiting' |