while : do echo "Ascent restarted `date`" echo `date` >> ~/crash.log & ./ascent | tail -n 20 >> ~/crash.log echo " " >> crash.log & pid=`ps ax | awk '($5 ~ /antrix/) { print $1 }'` wait $pid echo `date` ", Ascent crashed and restarted." >> ~/server.log done