|
|
| XP is just a number | |
| PerlMonks |
Using a Perl Script To Execute a Linux Commandby kgill (Initiate) |
| on Jan 23, 2008 at 16:01 UTC ( #663817=perlquestion: print w/ replies, xml ) | Need Help?? |
|
kgill has asked for the
wisdom of the Perl Monks concerning the following question:
Dear Monks,
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.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||