Top
ETERNUS SF AdvancedCopy Manager 14.2 Operator's Guide

A.2.3 Customizing the shell script

The method of customizing the shell script for backup pre- and post-processing is explained below.

When you do not want to unmount a transaction volume

If you do not want to unmount a mounted transaction volume, eliminate the comment characters ("#") in lines 101-110, 113 and 146 (in the case of a physical volume) or lines 163-172 (in the case of a volume group), and point to the target device in line 101 or line 163.

In addition, do not perform an update operation on a transaction volume file system after performing the sync command on line 108 or line 169 until backup post-processing. If a file system update is performed in the meantime, the backup is taken with a corrupted file system. In this case the fsck command executed by the post-processing may raise an error.

Backup a volume group

When you are backing up the volume group containing the logical volume used to build the file system, insert a comment character ("#") into line 158 of the pre-processing script (OpcBackup.pre) to remove the exit statement.

Note

  • Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.

  • When the backup volume is a volume group, in order to enable use of the backup volume as LVM, volume group configuration information is restored using the vgcfgrestore command in the post-processing. The information is restored from the standard backup file "/etc/lvmconf/volume-group-name.conf". If volume group configuration information is backed up by another file, please customize the script.

    In cluster operation, the respective nodes comprising the cluster must have volume group configuration information.

  • Correct the parameters and options, of the OS commands, such as the mount command and the fsck command, appropriately for their use.

  • For shared-mode volume groups:

    When reconfiguring shared-mode volume groups, comment out line numbers 90-138, 144, 145 and 150 in the post-processing script (OpcBackup.post) to prevent the volume group from being reconfigured by the script.
    Reconfigure the volume group by manually performing the following steps after the backup has been executed.

    1. Stop the volume group (on all nodes involved in the transaction).

      # /usr/sbin/vgchange -a n <vg_name>
      #
    2. Restore volume group configuration information on the node where the volume group was created.

      # /usr/sbin/vgcfgrestore -n <vg_name> <pv_path> 
      #
    3. Mark the volume group as shareable on the node where the volume group was created.

      # /usr/sbin/vgchange -S y -c y <vg_name> 
      #
    4. Start the volume group on all nodes involved in the transaction.

      # /usr/sbin/vgchange -a s <vg_name>
      #

File system name

Change the file system names on lines 217 and 301 of the post-processing shell script (OpcBackup.post) that is executed when backup is performed as appropriate for the operation.

Cluster operation by VERITAS Cluster Server

Customization of the pre-processing and post-processing scripts is required when performing cluster operations using VERITAS Cluster Server, and when the mount point of the transaction volume is registered in the cluster transaction.
Change unmount/mount processing in the pre-processing and post-processing scripts into offline/online processing of the mount point resource.
The mount point resource relating to the Volume is immediately offline/online whilst there will be a time delay before access is actually prevented when mount/unmount is used.
Please note that once the online/offline command is issued there will be a delay before the mount/unmount command can be executed. The sleep and df commands can be used to delay the mount/ unmount until after the process that sets the volumes online or offline has completed

The examples below show how the pre-processing and post-processing scripts are modified.

[Example]
Changing the unmount processing of the backup pre-processing script (OpcBackup.pre)0

[lines 115,124,181,193rd]

(before change)

 
/usr/sbin/umount $mount_point

(after change)

 
/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name
[Example]
Adding unmount wait processing to the backup pre-processing script (OpcBackup.pre)

line 145,213rd]

(addition)

 
while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done
[Example]
Changing the mount processing of the backup post-processing script (OpcBackup.post)

[lines 164,168,170,183,187,189,224,233rd]

(before change)

 
/usr/sbin/mount $device $mount_point
/usr/sbin/mount -F $fs $device $mount_point
/usr/sbin/mount -F $fs $lvname $lv_mount_point

(after change)

 
/opt/VRTSvcs/bin/hares -online resource-name -sys system-name
[Example]
Adding mount wait processing to the backup post-processing script (OpcBackup.post)

lines 209,252nd]

(addition)

 
while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done