HP StorageWorks Storage Mirroring scripting guide (T2558-96074, February 2008)

14 - 1
14 X Scripting Examples
Scripting Examples
This chapter contains sample Storage Mirroring scripts. Most of the sample scripts must be modified. They cannot be used
as-is. Modify them to fit your environment. If you need basic assistance with script modifications, contact Technical Support.
Assistance with advanced scripting will be referred to Professional Services.
Creating and connecting a replication set
The following script will start a Storage Mirroring connection by creating a repset called DataFiles and connecting it to the
machine beta.
Creating and connecting a replication set with failover
monitoring
The following script will start a Storage Mirroring connection by creating a repset called DataFiles and connecting it to the
machine beta. This script will also set up failover.
Restoring a replication set
The following script will restore the data in the DataFiles replication set from the target machine to the source machine.
NOTE: See Storage Mirroring scripts on page 2-3 for information on using Storage Mirroring scripts.
source alpha;
repset create DataFiles;
repset rule add c:\files include, recursive;
repset rule add c:\files\users exclude;
repset rule add d:\data include, recursive;
repset save;
connect DataFiles to beta map exact;
source alpha;
repset create DataFiles;
repset rule add c:\files include, recursive;
repset rule add c:\files\users exclude;
repset rule add d:\data include, recursive;
repset save;
connect DataFiles to beta map exact;
target beta;
monitor create alpha;
monitor move 205.31.4.193 to nic 3 interval 5 timeout 25;
monitor start alpha;
source alpha;
restore DataFiles to beta nooverwritenewer, usetargetdb;