michael@0: ############################################################# michael@0: # script to watch for cores during QA runs, so they won't overwrite one michael@0: # another michael@0: # Not activated for efficiency reasons, and problems on MKS, us michael@0: # only when needed and remember to remove afterwards michael@0: ############################################################# michael@0: michael@0: ############################################################# michael@0: # to activate put the following into all.sh (after the HOSTDIR michael@0: # has been exported michael@0: ############################################################# michael@0: # sh `dirname $0`/core_watch $HOSTDIR ${HOSTDIR} & michael@0: # CORE_WATCH_PID=$! michael@0: # if [ -n "${KILLPIDS}" ] michael@0: # then michael@0: # echo $CORE_WATCH_PID >>"${KILLPIDS}" michael@0: # fi michael@0: ############################################################# michael@0: michael@0: ############################################################# michael@0: # or put the following into nssqa to watch the whole RESULTDIR michael@0: # start it shortly before run_all michael@0: # michael@0: # NOTE: the more efficient way is above, this is potentially going michael@0: # thru 1000ds of files every 30 seconds michael@0: ############################################################# michael@0: # sh `dirname $0`/core_watch $RESULTDIR & michael@0: # echo $! >>"${KILLPIDS}" #so Exit() can hopefully kill the core_watch michael@0: ############################################################# michael@0: michael@0: # in both cases remember to kill the process when done, since michael@0: # the PIDs that end up in ${KILLPIDS} might not work for all OS michael@0: # something like "kill_by_name core_watch michael@0: michael@0: echo $$ >>"${KILLPIDS}" #so Exit() can hopefully kill this shell michael@0: while [ 1 ] michael@0: do michael@0: for w in `find $1 -name "core" -print` michael@0: do michael@0: echo "Found core $w" michael@0: mv $w $w.`date +%H%M%S` michael@0: done michael@0: sleep 30 michael@0: done michael@0: