|
This post was updated on .
Red Hat Linux 6
Hi,
I am writing a script which checks if the line 'IMP-00000: Import terminated successfully' is present in import dump logfile.
If it is not present, it will write and error in a variable in a file.
Please find below the script
cd /oldbackup/DNRTOOL/cidev/exportlog
arch1=$(ls -t | head -1)
res1=`grep "IMP-00000: Import terminated successfully" $arch1`
cd /oldbackup/DNRTOOL/gaiadev/exportlog
arch2=$(ls -t | head -1)
res2=`grep "IMP-00000: Import terminated successfully" $arch2`
cd /oldbackup/DNRTOOL/gcidev/exportlog
arch3=$(ls -t | head -1)
res3=`grep "IMP-00000: Import terminated successfully" $arch3`
if [ $(res= "") ]
then
sed -i 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG=ERROR IN CI/g' /comptel/DNR/DNRTOOL/FILES/application.properties
if [ $(res= "") ]
then
sed -i 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG=ERROR IN GAIA/g' /comptel/DNR/DNRTOOL/FILES/application.properties
if [ $(res= "") ]
then
sed -i 's/^IMPORTGAIAGCICIFLAG.*/IMPORTGAIAGCICIFLAG=ERROR IN GCI/g' /comptel/DNR/DNRTOOL/FILES/application.properties
fi
fi
fi
When running the script:
[oracle@rh-ftthprod-db1 DNRTOOL]$ ./checkERR.sh
./checkERR.sh: line 13: : command not found
Can you please advise.
Regards,
Roshan
|