|
Hi Erman!
Pls take a look.. Do you see any erros ? Logical flow ?
This shell script I need to put to the cron starting from 19:00 -20:00
IF it finds the row ->updates it straight way and quite for good,
If it doesn not, it seraches every 2 min and for 1 hour and then quite completely.
========================
while(true);
do
starttime=`date +%s`
end=$((starttime+3600))
while [[ $((`date +%s` - $starttime)) -lt 120 ]]; do
if [ `date +%s`-eq $end ]; then
break
fi
rows=`sqlplus -s<< EOF
apps/xxxx
whenever sqlerror exit 1
SET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF
select count(1)
from xxx where condition='123';
EOF`
if [ $rows -neq 0] ;
then
sqlplus -s << EOF1
apps/xxxx
update xxx set hold='Y' where
condition='123';
commit;
EOF1
echo "Done."
exit 0;
else
echo "once more."
fi
done
done
========
Thanks,Julie
|