
June 19th, 2004, 12:43 AM
|
|
Registered User
|
|
Join Date: May 2004
Location: Philippines
Posts: 14
Time spent in forums: 3 m 22 sec
Reputation Power: 0
|
|
Redirect output
I'm creating a shell script on checking the status if one of our application is active/up. The script will determine if it's up by issuing the full path command to check the status of the application. If that application is down, the script will automatically issue the command to startup the application. However, i cannot redirect the output of the command for checking the status of the application, there are few lines in that output that will determine that the application is up, but only the last 3 lines of the output were being redirected to a file, which is not important.
Below is my script:
ORACLE_HOME=/si02/oracle/tiasora/8.0.6/6iserver
# Check if discoverer is up
su - applias -c "$ORACLE_HOME/discwb4/util/checkdiscoverer.sh" > /tmp/moncpu/tias_dsicoverer.log
if
grep -e 'Error: OAD is not running. Discoverer will not function correctly.' /tmp/moncpu/tias_discoverer.log
then
su - applias -c "$ORACLE_HOME/startall.sh"
fi
The colored text is the important part of the output for me to determine that the application is down. But this part are not captured, only the last 3 lines are captured and being redirected.
I hope someone can help me. Thanks.
|