HP StorageWorks Storage Mirroring Scripting Guide (T2558-96327, April 2009)

17 - 4
Creating a backup or snapshot of the target by
inserting a task command during replication
The following script stops the services on the source, pauses the script to allow the source time to
write the remaining application data to disk, inserts a Storage Mirroring task command into the
Storage Mirroring replication process, and then restarts the services.
REM Stop the services on the source so that data changes are stopped.
net stop "Service Name 1"
net stop "Service Name 2"
net stop "Service Name 3"
net stop "Service Name 4"
REM Pause the source (for a specified number of seconds) to allow time for
REM the application data to be written to disk. The sleep command is available
REM from the Windows Resource Kit.
sleep 120
REM At this point the source application is stable (service is stopped and data
REM is written). Now, initiate your Storage Mirroring task command, for example to
REM trigger a snapshot or backup. The process you want to run on the target
REM must be contained in the batch file specified in the queuetask command.
REM That batch file must be stored on the target so that it can be executed
REM on the target.
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheSource = "alpha"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheTarget = "beta"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheUserName =
"administrator"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $ThePassword =
"password"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl $TheDomain =
"domain.com"
C:\Program Files\StorageWorks\Storage Mirroring\dtcl login $TheSource
$TheUserName $ThePassword $TheDomainName
C:\Program Files\StorageWorks\Storage Mirroring\dtcl login $TheTarget
$TheUserName $ThePassword $TheDomainName
C:\Program Files\StorageWorks\Storage Mirroring\dtcl queuetask backup to
$TheTarget onexecute=Backup.bat timeout=forever
REM Now that the task command has been inserted inline with Storage Mirroring
replication, the
REM services can be restarted New changes to the data will fall inline behind
the task
REM command just inserted.
net start "Service Name 1"
net start "Service Name 2"
net start "Service Name 3"
net start "Service Name 4"