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