kgill has asked for the wisdom of the Perl Monks concerning the following question:
I am a Unix/Linux server administrator for a company, and I am a "newbie" in the purest sense of the word in terms of Perl. I'm able to make Perl files using the VI in Unix. I'm trying to get two scripts running--one to stop or start my database server that is running Oracle and one to start or stop my application server that is running Oracle. Currently, I'm entering the commands manually, but I would like to schedule the scripts to run every Friday to shutdown and Monday to startup.
A few of the commands needed to start and stop the database and application servers involve changing directories to execute the commands. How can I write a nice, clean script that can do this?
Thanks, Kris
P.S. Here's a mock-up of what I'm trying to accomplish:
SHUTDOWN
APPLICATION SERVER
login <user>
cd /opt/SIV/inst/apps/SIV_<servername>/admin/scripts ./adstpall.sh pass/pass
login <user>
cd /opt/SIV/db/tech_st/10.2.0 . ./SIV_<servername>.env
sqlplus / as sysdba
shutdown immediate
exit
lsnrctl stop VIS
A similiar script would be needed for the startup.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using a Perl Script To Execute a Linux Command
by MidLifeXis (Monsignor) on Jan 23, 2008 at 16:39 UTC | |
by kgill (Initiate) on Jan 23, 2008 at 16:51 UTC | |
|
Re: Using a Perl Script To Execute a Linux Command
by igelkott (Priest) on Jan 23, 2008 at 16:47 UTC | |
|
Re: Using a Perl Script To Execute a Linux Command
by Anonymous Monk on Jan 24, 2008 at 08:05 UTC |