HP StorageWorks Storage Mirroring for Linux User's Guide (T2558-96078, February 2008)

A - 43
DTCL Scripting Examples
This section shows examples of different script files.
Basic getting started script
The following script will start a Storage Mirroring connection by creating a repset called Customer Data and connecting it to
the machine Jersey.
Basic getting started script with failover
The following script will start a Storage Mirroring connection by creating a repset called Customer Data and connecting it to
the machine Jersey. This script will also set up failover.
Basic restore script
The following script will restore the data in the Customer Data replication set from the target machine to the source machine.
Basic getting started script with variables
The following script uses variables to identify the source, target, and replication set. These variables are then used in the
DTCL commands. The $connectionID variable will contain the connection ID for the connection established. This variable
can then be used to establish a verification schedule.
source indy;
repset create “Customer Data”;
repset rule add /home/files include, recursive;
repset rule add /home/files/temp exclude;
repset rule add /home/data include, recursive;
repset save;
connect “Customer Data” to jersey map exact;
source indy;
repset create “Customer Data”;
repset rule add /home/files include, recursive;
repset rule add /home/files/temp exclude;
repset rule add /home/data include, recursive;
repset save;
connect “Customer Data” to jersey map exact;
target jersey;
monitor create indy;
monitor move 205.31.4.193 to nic 3 interval 5 timeout 25;
monitor start indy;
source indy;
restore “Customer Data” to jersey nooverwritenewer, usetargetdb;
$TheTarget = “jersey”;
$TheSource = “indy”;
$TheRepset = “Customer Data”;
source $TheSource;
repset create $TheRepset;
repset rule add /home/files include, recursive;
repset rule add /home/files/temp exclude;
repset rule add /home/data include, recursive;
repset save;
$ConnectionID = connect $TheRepset to $TheTarget map exact;
verify $ConnectionID sync, newer, checksum, every 12 hr;