HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

rc script for drd sync

 
madhuca-
Occasional Advisor

rc script for drd sync

Hi All I am upgrading OS to March 2015 using DRD clone.

After taking DRD clone I will be executing drd sync to update if any files from activte system image.

Here I need to set up a rc script to run drd sync for all MOunt points in vg00.

I have taken the sample script from admin guide.

 

#!/sbin/sh
#
# synchronize source root group with cloned root group
# drd-sync(1M).
#
PATH=/sbin:/usr/sbin:/usr/bin:/opt/drd/bin
export PATH
rval=0
DRD_MOUNT_PT=/var/opt/drd/mnts/sysimage_001
set_return() {
if [ $1 -ne 0 ]; then
echo $2
rval=1
fi
}
case $1 in
stop_msg)
echo "Running drd sync to synchronize cloned root file systems"
;;
Using the drd sync preview to determine divergence of the clone from the booted system 29
stop)
# Synchronize the source disk with the cloned system
drd mount >/dev/null 2>&1 # Ignore errors, may already be mounted.
drd sync
sync_ret=$?
set_return $sync_ret "ERROR: Return code from drd sync is $sync_ret"
rm -f $0 ${DRD_MOUNT_PT}$0 > /dev/null 2>&1
[[ -x $0 ]] && \
set_return 1 "ERROR: The $0 script (on image being shut down) could not be removed."
[[ -x ${DRD_MOUNT_PT}$0 ]] && \
set_return 1 "ERROR: The ${DRD_MOUNT_PT}$0 script ($0 on clone) could not be removed."
drd umount >/dev/null 2>&1 # Ignore errors.
;;
*)
echo "usage: $0 { stop_msg | stop }"
rval=1
;;
esac
exit $rval

 

------------------------------------

I have other file system as below

/var/opt/drd/mnts/sysimage_001

/var/opt/drd/mnts/sysimage_001/home
/var/opt/drd/mnts/sysimage_001/opt
/var/opt/drd/mnts/sysimage_001/stand
/var/opt/drd/mnts/sysimage_001/tmp
/var/opt/drd/mnts/sysimage_001/usr
/var/opt/drd/mnts/sysimage_001/var

 

How can i edit in the script to update drd sync for all other mount points and to set up a rc script.

 

Regards