5-8
Using the Storage Navigator CLI
Hitachi Universal Storage Platform V/VM Hitachi Storage Navigator User’s Guide
The following examples show a batch file for the CFLSET command. The "
"
symbol indicates the end of a command line.
For Windows:
java -jar -Djava.security.policy=java.policy JSanCLI.jar myAuthentication.txt CFLSET %1 %2
↵
For UNIX:
#! /bin/csh
↵
java -jar -Djava.security.policy=java.policy JSanCLI.jar myAuthentication.txt CFLSET
$ $
1 2
↵
The following items may need to be changed in some cases:
•
The installation directory of a shell program
If your operating system is UNIX and a shell program is installed in a
directory other than "/bin", you need to change "#! /bin/csh" in the first
line to the installation directory of a shell program (such as /usr/bin/csh).
•
The user authentication file name
If you rename the user authentication file, you need to change
"myAuthentication.txt" to the file name that you specified.
When you store the user authentication file in a directory other than
"CFLCLITool" (for example, user's home directory), you need to specify the
relative or absolute path. Only single-byte characters can be specified for a
path or file name. No double-byte characters can be specified.
The termination codes that Storage Navigator CLI returns when a batch file is
executed are as follows:
–
0: The command finished successfully.
–
other than 0: The command finished abnormally (An error occurred).
If you want to use a reference to a termination code in your batch file, do the
following:
–
For a Windows batch file, write %
errorlevel
% in the batch file.
–
For a UNIX Bourne shell script, write %
?
in the shell script.
–
For a UNIX C shell script, write %
status
in the shell script.
The following example is a reference to a termination code used in a Windows
batch file. When this batch file is executed and Storage Navigator CLI returns
the termination code other than 0, the command prompt displays a message
indicating the command failed. When this batch file is executed and Storage
Navigator CLI returns the termination code 0, the command prompt displays a
message indicating the command finished successfully.
java -Djava.security.policy=java.policy -jar JSanCLI.jar myAuthentication.txt CFLGET %1 %2
↵
if %errorlevel% NEQ 0 echo COMMAND FAILED.
↵
if %errorlevel% EQU 0 echo COMMAND SUCCESSFUL.
↵