Using the DS CLI script command mode

Use the DS CLI script command mode if you want to enter a sequence of DS CLI commands. Administrators can use this mode to create automated processes. For example, this mode can be used to establish remote mirror and copy relationships for volume pairs.

Before you begin

Consider the following requirements when you use the DS CLI script command mode:
  • The DS CLI script can contain only DS CLI commands. Use of shell commands results in a process failure.
  • You can add comments to the scripts. Comments must be prefixed by the number sign (#). For example, # This script contains PPRC Path establish procedures.
  • Set the echo environment variable by using the dscli profile file or use the setenv command to specify that the dscli command name is displayed before the command output.
Note: An example script is displayed for your use as a guide.

About this task

You can enter the DS CLI script from the command prompt at the same time that you provide your login information.

Procedure

  1. Enter the script name at the command prompt by using the following format:
    dscli -hmc1 9.1.23.45 -user admin -passwd password 
    -script ~/bin/mkpprcpairs
    Note: If you are using IBM i and logged on to the DS CLI, you start the script mode by using the following format:
    DSCLI SCRIPT('/myscript') USER(admin) OUTPUT('/outfile')
  2. Wait for the script to provide success or failure of the process.

Example

The following example shows a script that is used to establish remote mirror and copy relationships for volume pairs for the storage system:
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type mmir 1000-103F:2300-233F
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type gcp 1100-113F:2340-237F
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type mmir 1800-187F:2800-287F
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type gcp 1200-127F:2500-257F
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type mmir 1040-1054:2700-2714
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type gcp 1055-107F:2400-242A
mkpprc -dev IBM.2107-1303561 -remotedev IBM.2107-7504491 -type mmir 1140-117F:2600-263F