LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-03-2008, 05:13 AM   #1
yusufs
Member
 
Registered: Oct 2007
Posts: 162

Rep: Reputation: 30
double execution in script


Hai all,

am havin 2 scripts as follows :
Script one :
***********
#Script used to monitor Apache Server availability
LOGFILE=/tmp/apache_updown.log
adapcctl.sh status
if [ $? -eq 1 ]
then
echo "$ORACLE_SID - Apache is down" > $LOGFILE
exit 1
else
exit 0
fi

Script two :
***********

#Script used to monitor creation of forms dump files
FORMS_DIR=$1
LOGFILE=/tmp/forms_dumpfiles_$ORACLE_SID.log
ls -l $FORMS_DIR/f60webmx_dump* > $LOGFILE
if [ $? -eq 0 ]
then
# There are dump files, return an error code
exit 1
else
exit 0
fi




How can I have the above 2 scripts in a single script such that when it is executed it will run both the script and give the output..

Please Guide
Yusuf
 
Old 01-03-2008, 05:21 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Something like...

#monitor Apache Server availability
LOGFILE1=/tmp/apache_updown.log
adapcctl.sh status

if [ $? -eq 1 ]
then
echo "$ORACLE_SID - Apache is down" > $LOGFILE1
exit 1
fi

#monitor creation of forms dump files
FORMS_DIR=$1
LOGFILE2=/tmp/forms_dumpfiles_$ORACLE_SID.log
ls -l $FORMS_DIR/f60webmx_dump* > $LOGFILE2
if [ $? -eq 0 ]
then
# There are dump files, return an error code
exit 2
fi

exit 0

If both scripts use input, then you'll want to distinguish them by defining options.
 
Old 01-03-2008, 05:25 AM   #3
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
I'm guessing you didn't write the scripts. Have you tried anything? From reading your other posts, it seems that you just want the answer without learning/researching how things work. Try answering your own question and then post problems that you have.

-twantrd
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with script execution in bashrc globemast Linux - Newbie 4 11-07-2007 04:42 AM
script execution yakoub Linux - Software 3 11-12-2006 02:26 AM
Script execution salmanucit Linux - Software 1 12-08-2005 09:51 AM
script execution error linux_lover2005 Programming 3 12-22-2004 07:46 AM
script execution Johng Programming 2 08-21-2004 05:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration