UPDATE SCRIPT (Update an IBM Spectrum Protect script)
Use this command to change a command line or to add a new command line to an IBM Spectrum Protect script.
run script1 > c:\temp\test.out
Privilege class
To issue this command, the administrator must have previously defined the script or must have system privilege.
Syntax
Parameters
- script_name (Required)
- Specifies the name of the script to be updated.
- command_line
- Specifies a new or updated command to be processed in a script. You must update a command, a
description, or both when you issue this command.
Command can contain substitution variables and may be continued across multiple lines if you specify a continuation character (-) as the last character in the command. You can specify up to 1200 characters for the command. Enclose the command in quotation marks if it contains blanks. If you specify this parameter, you can optionally specify the following parameter.
You have the options of running commands serially, in parallel, or serially and in parallel by specifying the SERIAL or PARALLEL script commands for this parameter. You can run multiple commands in parallel and wait for them to complete before proceeding to the next command. Commands will run serially until the parallel command is encountered.
Restriction: If you specify a script with the PARALLEL command, do not include a SHOW, QUERY, or SELECT command in the script. This restriction applies to all scripts, including scripts that call other scripts.Conditional logic flow statements can be used. These statements include IF, EXIT, and GOTO.
- Line
- Specifies the line number for the command. If you do not specify a line number, the command line
is appended to the existing series of command lines. The appended command line is assigned a line
number of five greater than the last command line number in the sequence. For example, if the last
line in your script is 015, the appended command line is assigned a line number of 020.
If you specify a line number, the command will replace an existing line (if the number is the same as an existing line). Or the command will insert the specified line (if the line number does not correspond to an existing line number for the command line sequence).
- DESCription
- Specifies a description for the script. You can specify up to 255 characters for the description. Enclose the description in quotation marks if it contains blank characters.
Example: Add a command to the end of a script
Assume that you have defined the following three line script, named QSAMPLE, and that you want to add the QUERY SESSION command to the end of the script. 001 /* This is a sample script */
005 QUERY STATUS
010 QUERY PROCESS
update script qsample "query session"
After
the command processes, the script now consists of the following lines: 001 /* This is a sample script */
005 QUERY STATUS
010 QUERY PROCESS
015 QUERY SESSION
Example: Update a specific line a script
Using the script from the prior example, change line 010 so that it processes the QUERY STGPOOL command instead of the QUERY PROCESS command:update script qsample "query stgpool" line=010
After
the command processes, the script now consists of the following lines: 001 /* This is a sample script */
005 QUERY STATUS
010 QUERY STGPOOL
015 QUERY SESSION
Example: Insert a command in the middle of a script
Using the script from the prior example, insert a new command line (QUERY NODE) after the QUERY STATUS command line in the QSAMPLE script:update script qsample "query node"
line=007
After the command processes, the
script now consists of the following lines:
001 /* This is a sample script */
005 QUERY STATUS
007 QUERY NODE
010 QUERY STGPOOL
015 QUERY SESSION
Related commands
Command | Description |
---|---|
COPY SCRIPT | Creates a copy of a script. |
DEFINE SCRIPT | Defines a script to the IBM Spectrum Protect server. |
DELETE SCRIPT | Deletes the script or individual lines from the script. |
QUERY SCRIPT | Displays information about scripts. |
RENAME SCRIPT | Renames a script to a new name. |
RUN | Runs a script. |