LinuxQuestions.org
Review your favorite Linux distribution.
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, 04: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, 04:21 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
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, 04:25 AM   #3
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,438

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 03:42 AM
script execution yakoub Linux - Software 3 11-12-2006 01:26 AM
Script execution salmanucit Linux - Software 1 12-08-2005 08:51 AM
script execution error linux_lover2005 Programming 3 12-22-2004 06:46 AM
script execution Johng Programming 2 08-21-2004 04:58 PM


All times are GMT -5. The time now is 01:24 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration