#!/bin/sh

DATE=`date "+%m-%d-%Y"`
BACKUP="/etc/dgbackups"

if [ -d ${BACKUP} ] && [ -f "/usr/sbin/vxdg" ] && [ -f "/usr/sbin/vxprint" ]
then
        for DG in `/usr/sbin/vxdg -q list | awk '{print $1}'`
        do
                /usr/sbin/vxprint -g ${DG} -hmQq > ${BACKUP}/${DG}.${DATE}
        done
else
	# Can't find something we need -- exit() with an error
        echo "Check to make sure ${BACKUP}, vxdg and vxprint exist."
	exit 1
fi

exit 0

