|Pathologically Eclectic Rubbish Lister|
Using a Perl Script To Execute a Linux Commandby kgill (Initiate)
|on Jan 23, 2008 at 16:01 UTC||Need Help??|
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?
P.S. Here's a mock-up of what I'm trying to accomplish:
cd /opt/SIV/inst/apps/SIV_<servername>/admin/scripts ./adstpall.sh pass/pass
cd /opt/SIV/db/tech_st/10.2.0 . ./SIV_<servername>.env
sqlplus / as sysdba
lsnrctl stop VIS
A similiar script would be needed for the startup.