204
DS6000 Series: Concepts and Architecture
exit status of dscli = 0
C:\Program Files\IBM\dscli>
It is also possible to include single commands in a script, though this is different from the
script mode
described later. This is because every command that uses the DS CLI would
invoke the DS CLI and then exit it. A simple Windows script is shown in Example 10-2.
Example 10-2 A script to list all users and place their names in a file
@ECHO OFF
rem This script is used to list all DS CLI users
rem The lsuser command is executed and the output is sent to file called userlist.txt
dscli lsuser > userlist.txt
echo The user list has been created and placed in userlist.txt
If you are familiar with UNIX, then a simple example of creating a script is shown in
Example 10-3.
Example 10-3 Creating a DS CLI script
/opt/ibm/dscli >echo “dscli lsuser > userlist.txt” > listusers.sh
/opt/ibm/dscli >chmod +x listusers.sh
/opt/ibm/dscli >./listusers.sh
/opt/ibm/dscli >cat userlist.txt
Name Group
=========================
admin admin
/opt/ibm/dscli>
Interactive mode
In the interactive mode, the user starts the DS CLI program within a shell, and then issues DS
CLI commands until the DS CLI is no longer needed. At this point the user exits the DS CLI
program. To avoid having to enter authentication details, a profile or a password file would
have to be created first. The use of the interactive mode is shown in Example 10-4.
Example 10-4 Using DS CLI in interactive mode
C:\Program Files\IBM\dscli>dscli
dscli> lsuser
Name Group
=========================
admin admin
csadmin op_copy_services
dscli> exit
exit status of dscli = 0
C:\Program Files\IBM\dscli>
Script mode
The script mode allows a user to create a DS CLI script that contains multiple DS CLI
commands. These commands are performed one after the other. When the DS CLI executes
the last command, it ends and presents a return code. DS CLI scripts in this mode must
contain only DS CLI commands. This is because all commands in the script are executed by
Summary of Contents for System storage DS6000 Series
Page 2: ......
Page 5: ...iii...
Page 6: ...iv DS6000 Series Concepts and Architecture...
Page 18: ...xvi DS6000 Series Concepts and Architecture...
Page 24: ...xxii DS6000 Series Concepts and Architecture...
Page 26: ...2 DS6000 Series Concepts and Architecture...
Page 44: ...20 DS6000 Series Concepts and Architecture...
Page 46: ...22 DS6000 Series Concepts and Architecture...
Page 68: ...44 DS6000 Series Concepts and Architecture...
Page 88: ...64 DS6000 Series Concepts and Architecture...
Page 136: ...112 DS6000 Series Concepts and Architecture...
Page 138: ...114 DS6000 Series Concepts and Architecture...
Page 218: ...194 DS6000 Series Concepts and Architecture...
Page 242: ...218 DS6000 Series Concepts and Architecture...
Page 266: ...242 DS6000 Series Concepts and Architecture...
Page 298: ...274 DS6000 Series Concepts and Architecture...
Page 352: ...328 DS6000 Series Concepts and Architecture...
Page 392: ...368 DS6000 Series Concepts and Architecture...
Page 396: ...372 DS6000 Series Concepts and Architecture...
Page 404: ...DS6000 Series Concepts and Architecture DS6000 Series Concepts and Architecture...
Page 405: ......