cmdsess
Use the cmdsess command to run a specific action against a session.
Syntax
Parameters
- -help | -h | -?
- Lists help for the command. If you specify additional parameters and arguments, those parameters and arguments are ignored.
- -quiet
- Suppresses the confirmation prompt for this command. This flag answers yes to all confirmation prompts.
- -action action_type
- Specifies the action type (command) depending on the state and type of session. The possible action types are displayed in the syntax diagram and are described in the IBM® Copy Services Manager User's Guide.
- -backupid backup_id
- Specifies the ID of the backup that you want to use to for the specified command.
- -snapshotname snapshot_name
- Specifies the name for the snapshot that is to be used for the specified command.
- -retentiondays retention_days
- Specifies the number of days this new backup or safeguarded snapshot is to be kept on the hardware. The hardware expires the backup or snapshot automatically after the specified number of days are passed.
- -restorefrom snapshot_group_name
- Specifies the new name for the snapshot group that you want to use to restore the data in the H1 volumes for the session. The snapshot group must be in the session.
- -priority { 1 | 2 | 3 | 4 }
- Specifies the priority in which the snapshot group is deleted from the session. The value is the number 1 - 4. A value of 1 specifies that the snapshot group is deleted last. A value of 4 specifies that the snapshot group is deleted first.
- -newname snapshot_group_name
- Specifies the new name for the snapshot group.
- session_name | -
-
Specifies the name of the session that the action will run against.
Alternatively, use the dash (-) to specify that input for this parameter comes from an input stream (stdin). The dash is supported only in single-shot mode.
Example: Starting a session
The following command runs the Start H1->H2->H3 action on session session1:
csmcli> cmdsess -action start_h1:h2:h3 session1
The following output is returned:
IWNR1813W This command will initiate the copying of data from Site 1 to Site 2 and Site 3 for session session1, overwriting any data on Site 2 and Site 3 for any inactive copy sets. For ESS/DS devices, exactly one path will be established between each LSS pair without existing paths. Do you want to continue? [y/n]:y IWNR1027I The command Start H1->H2->H3 in session session1 has completed successfully.
Example: Reversing the direction of replication
The following command runs the Enable Copy to Site 1 action on the session1 session without prompting for confirmation:
csmcli> cmdsess -quiet -action enable_copy_to_site_1 session1
The following output is returned:
IWNR1027I The command Enable Copy to Site 1 in session session1 has completed successfully.
For multi-target session types, the equivalent parameter is set_production_to_site_x, where x is the production site. For example, the parameter set_production_to_site_2 enables data replication from Site 2 to Site 1 and Site 3.
Example: Creating a snapshot group in a FlashSystem/IBM Spectrum® Accelerate snapshot session
The following command creates a snapshot group in session snap1:
csmcli> cmdsess -action create_snapshot snap1
The following output is returned:
IWNR1855W This command will create a new snapshot group containing snapshots of the source volumes in session snap1. Do you want to continue? [y/n]:y
IWNR1026I The Create Snapshot command in session snap1 has completed.