#!/bin/ksh # $Id: sbp.ksh,v 2.0 2004/01/11 20:47:39 ksb Exp $ # Synchronizes the backup partitions with the primary partitions. (ksb) # Builds a shell script on stdout; please verify first, then execute. # # This script was coded orinally by Greg Rivers (gcr) and ksb. # This is a simplified version of Greg's work, to document what we # are replacing. The script version worked for years, but had some # hard coded knowlege (like all primary and backup slices had to # live on targets t0/t1 and had to be on the same controller). # # When we moved to hosts with more contollers we had to "upgrade" sbp, # as a side effect the new one works on more platforms. echo "#!/bin/sh" date +"# built %c on `hostname`" echo set -e sed -e 's!/dsk/!/rdsk/!' /backup/etc/vfstab" sed -e 's/t0d/tXd/g' /etc/vfstab | sed -e 's/t1d/t0d/g' | sed -e 's/tXd/t1d/g' echo ! echo cd /\; sync\; sync awk '/^[^ ]*[ ]*[^ ]*[ ]*\/backup/{print $3}' /etc/vfstab | sort -r | while read MOUNTPOINT do echo umount $MOUNTPOINT done exit 0