IBM Tivoli Storage Manager, Version 7.1

MACRO (Invoke a macro)

Use this command to invoke a file from the administrative command line that contains one or more Tivoli® Storage Manager administrative commands to be performed.

Restriction: Use this command with administrative command-line clients only.

A macro is a file that contains one or more Tivoli Storage Manager administrative commands. You can only issue a macro from the administrative client in batch or interactive mode. A macro is stored as a file on the administrative client machine (or system). Macros are not distributed across servers and cannot be scheduled on the server.

Creating a macro to enter commands can be helpful when you want to issue commands that are used repeatedly, to issue commands that contain several parameters, or to process related commands in a specific order. After you create a macro, you can update the information it contains and use it again, or you can copy the macro file, make changes to the copy, and then run the copy.

For detailed information on macros, how to use them, and the differences between command scripts and administrative command-line client macros, refer to the Administrator's Guide.

Privilege class

Any administrator can issue this command.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-MACRO--macro_name--+------------------------+---------------><
                      | .--------------------. |   
                      | V                    | |   
                      '---substitution_value-+-'   

Parameters

macro_name (Required)
Specifies the name of the macro.
substitution_value
Specifies the value for a substitution variable in a macro. When you use a substitution variable, you can reuse a macro whenever you need to perform the same task for different objects or with different parameter values. To specify a value that contains blanks, you must enclose the value in quotation marks. This parameter is optional.

Example: Create a macro to register a new administrator

Create a macro file named REGNG. Use the macro to register and grant authority to a new administrator. Write the macro as follows:
/* Register and grant authority to a new administrator */
REGister Admin jones passwd        -
CONtactinfo="x1235"
GRant AUTHority jones              -
CLasses=Policy
Issue the following command to run the macro:
macro regng.mac

Example: Write a macro using substitution variables

Create a macro file named AUTHRG, containing substitution variables, to register and grant authority to a new administrator. Write the macro as follows:
/*   Register and grant authority to a new administrator */
REGister Admin %1 %2  -        /*  Enter userid and password  */
CONtact=%3         /* Enter contact info (in quotes if nec.) */
GRant AUTHority %1  -        /*  Server uses variable already */
-                                         /*  defined by you */
CLasses=%4                     /*  Enter the privilege class  */
Issue a command similar to the following, entering the values you want to pass to the server to process the command when you run the macro.
macro authrg.mac jones passwd x1235 Policy

Related commands

Table 1. Commands related to MACRO
Command Description
COMMIT Makes changes to the database permanent.
ROLLBACK Discards any uncommitted changes to the database since the last COMMIT was executed.


Feedback