#!/bin/sh
heart=/archlog2/archive_2/heartbeat
while true
do
for file in `cat $heart`;
do
echo "wei xiugai qian $file"
if [ $file -eq 1 ]; then
echo "0" > $heart
cd /oracle/app/oracle/audit_hrb
./stop.sh
echo "stop program"
elif [ $file -eq 0 ]; then
cd /oracle/app/oracle/audit_hrb
./start.sh
echo "start program"
echo "2" >$heart
else
echo "program is running"
fi
done
var=$(echo `cat $heart`| awk '{print $1}')
echo "xiugai hou $var"
echo "start sleep one hour"
sleep 3720
#sleep 60
done