超级版主
#!/bin/csh # Script Name: AD6548 correcion factor check script # Function : script created for ad6548 correction facotr check # and remove offset files which older than 2 months # Rev0 - First release # By: # Rev1 - Add pop up window for no correction factor remind # By: ################################################################### # this scripts need to be released to /home3/msl/.ad6548_silveroff/ ################################################################### set expire_days = 30 ##########days to expire correction factor set home_dir = "/home3/msl/.ad6548_silveroff/" set log_file = $home_dir"ad6548_offset_file_check.log" set temp_file = $home_dir"cf_check.temp" set host_id = `hostname` set tester_id = `echo $host_id|cut -c 1-8` set tester_id = "$tester_id""t" set home_dir = $home_dir$tester_id"/" set backup_dir = $home_dir"backup/" set today = `date '+%d-%m-%Y'` set tstamp = `date '+_%m_%d'` set toweek = `date '+%w'` set tonow = `date '+%H'` set exp_cnt = 0 if (-d $home_dir) then ### check offset file dir ### if (! -d $backup_dir) then mkdir $backup_dir chmod 777 $backup_dir endif ### Monday to Friday day shift ### if ( $toweek > 0 && $toweek < 6 && $tonow > 8 && $tonow < 18 ) then ### start to check offset file ### echo "" > $temp_file find $home_dir -mtime +$expire_days -name '*silver_offset*' -exec ls {} >> $temp_file \; ### check every offset file in dir ### foreach record(`sed -n '/silver_offset/p' $temp_file`) set cf_file = $record set cf_noback = `echo $record|sed 's/backup//g'` #delete backup in full file name if ( $cf_file == $cf_noback ) then #current file is valid file, not in backup folder set exp_cnt = `expr $exp_cnt + 1` set cf_name = `echo $cf_file|sed 's/^\/[a-z0-9\/\.\_\-]*\///g'` # get file name without path echo `ls -l $cf_file|nawk -F " " '{print $6"-"$7"-"$8" "$9}'`" -- deleted at $today" >> $log_file cp -p $cf_file $backup_dir$cf_name"_at"$tstamp rm $cf_file echo "" >> $log_file endif end ### print how many offset files expired ### if ( $exp_cnt > 0) then echo "+---------------------------------------------------------------+" echo "| "$exp_cnt" correction factor files expired and deleted (exp "$expire_days" days) |" echo "| need to re-generate if program can not read correction factor |" echo "+---------------------------------------------------------------+" endif #************************************************************************** ### check is there any offset file still avaliable #************************************************************************** echo "" > $temp_file set exp_cnt = 0 find $home_dir -name '*silver_offset*' -exec ls {} >> $temp_file \; ### check every offset file in dir ### foreach record(`sed -n '/silver_offset/p' $temp_file`) set cf_file = $record set cf_noback = `echo $record|sed 's/backup//g'` #delete backup in full file name if ( $cf_file == $cf_noback ) then #current file is valid file, not in backup folder set exp_cnt = `expr $exp_cnt + 1` endif end if ( $exp_cnt == 0) then echo "+--------------------------------------------------------------------+" echo "+ No creation factor is avaliable, please infrom LSG/PE to generate. +" echo "+--------------------------------------------------------------------+" #### popup x-window for alert if ( -f "/home3/msl/.ad6548_silveroff/No_CF_Error" ) then setenv LD_LIBRARY_PATH /image/bin.rls/custom/qa_custom/scripts/scan_startlot_endlot/STATS/ESUMMARY/lib /home3/msl/.ad6548_silveroff/No_CF_Error & setenv LD_LIBRARY_PATH /image/bin.rls/lib else echo "Warning\! No correction factor alert window missing\! PLEASE CALL PE\!" endif #### delete prod program and load correction factor program ## delete echo "+----------------------------------------------------------------------------------+" echo "Production program deleted, please call LSG/PE to run correction factor immediately\!" echo "+----------------------------------------------------------------------------------+" sleep 1; load "/home3/msl/.ad6548_silveroff/F_AD6548_2p2_TTR_DS_CAT_v0802_036_gen_subsilver_1/pd_ad6548_70d11_v0802_offset.load" echo "+-----------------------------------------------------------+" echo "+ PD pgm deleted, please call LSG/PE to run CF immediately\! +" echo "+ Correction factor program auto loaded, no need to reload\! +" echo "+-----------------------------------------------------------+" banner "CF pgm loaded" endif ### end of offset files checking ### endif else echo "###############################################" echo "#Current tester has no Correction factor files#" echo "###############################################" exit 0 endif echo "+--------------------------------------------+" echo "| Correction factor files checking completed |" echo "+--------------------------------------------+" exit 0复制代码
使用道具 举报
发表回复 回帖后跳转到最后一页
Archiver|IC Test Forum Inc.
GMT+8, 2023-3-31 11:56 , Processed in 0.291584 second(s), 11 queries .
Powered by Discuz! X2
© 2001-2011 Comsenz Inc.