1830899 Members
3447 Online
110017 Solutions
New Discussion

Re: Scripting Ignite

 
Mike Allinger
Occasional Contributor

Scripting Ignite

When my script calls /opt/ignite/binia/make_tape_recovery
I get Execute permission denied.
Exit Status for IGNITE: 126

My simple script look like this
#--------------------------------------------
# ignite
#-------------------------------------------
/opt/ignite/binia/make_tape_recovery




Any ideas why i'm getting that error. I able to execute the script.
4 REPLIES 4
Jeff_Traigle
Honored Contributor

Re: Scripting Ignite

Played a bit. You're trying to run the Itanium version. I get the "Execute permission denied" on my PA-RISC box. Why aren't you using "/opt/ignite/bin/make_tape_recovery"? When Ignite installs, it creates the bin symlink to point to the proper architecture directory.
--
Jeff Traigle
Bill Hassell
Honored Contributor

Re: Scripting Ignite

The first error is spelling. It should be:

/opt/ignite/bin/make_tape_recovery
not
/opt/ignite/binia/make_tape_recovery

And you need a *lot* of parameters. The command would not work even if you typed it at the command line. Before you script something, always test it manually and then copy what you did to the script. This is the most common command line:

/opt/ignite/bin/make_tape_recovery -Iv -x inc_entire=vg00 -a /dev/rmt/0mn

Now in a script, it is usually wise to pickup values that may change from the command line. The most common for a backup program is the tape device, so in your script you might pickup parameter #1 as the tape device:

#!/usr/bin/sh
set -u
umask 022
export PATH=/usr/bin:/opt/ignite/bin:/sbin:/usr/sbin
MYTAPE=$1
/opt/ignite/bin/make_tape_recovery -Iv -x inc_entire=vg00 -a $MYTAPE

Note that all your scripts must start with the #! line specifying the desired interpreter. While you can accidently make a script work, someone else may try to use it and the defaults won't work. Specifying the interpreter eliminates that problem. The set -u makes sure that the script stops running if you have aq spelling error with a variable and the umask makes sure that within your script, reasonable permissions are set for any files created. The PATH statement is replaced (just within the script) to prevent accidental usage of programs that are not in the proper directories.

Now your script should also chaeck that there is a tape drive at $MYTAPE (hint: mt -f $MYTAPE status), and that the tape is write-enabled.


Bill Hassell, sysadmin
Sameer_Nirmal
Honored Contributor

Re: Scripting Ignite

Hi Mike,

You need to use /opt/ignite/bin/make_tape_recovery in the script.

The command in /opt/ignite/bin would be the one based on the hardware platform of the server. With HPUX 11.23 both the versions would be install in /opt/ignite/binia ( Itanuim) and /opt/ignite/binpa ( PA-RISC ). But in /opt/ignite/bin , correct version would be installed based on your server h/w platform.

So if you have PA-RISC based server and you are explicitly trying to run the Itanium based command you might get similar error.
Mike Allinger
Occasional Contributor

Re: Scripting Ignite

Thanks all!

When I changed the script to launch the make_tape_recovery from /opt/ignite/bin/
it worked fine.

As you probably are aware already I'm a newbie to Unix. This was my first posting on the IT resource center, and I have to say you all where quick to responed.

Thanks again!!
Mike