Date: Mon, 27 Jan 2003 18:25:31 -0200 (BRST) From: Joao Carlos Mendes Luis <jonny@crie.coppe.ufrj.br> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/47566: Suggested patch: vinum status verification Message-ID: <20030127202531.EFB214477C6@crie.coppe.ufrj.br>
index | next in thread | raw e-mail
>Number: 47566
>Category: bin
>Synopsis: Suggested patch: vinum status verification
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Jan 27 12:30:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Joao Carlos Mendes Luis
>Release: FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD krakatoa.crie.coppe.ufrj.br 4.7-STABLE FreeBSD 4.7-STABLE #0: Tue Nov 26 18:43:55 BRST 2002 jonny@krakatoa.crie.coppe.ufrj.br:/usr/cvsup/RELENG_4/src/sys/compile/KRAKATOA i386
>Description:
Currently vinum does not send any reports by email. This script, to be used in daily periodic checks for differences in vinum status.
>How-To-Repeat:
>Fix:
#!/bin/sh
#
# $Id: 230.backup-vinum,v 1.1 2003/01/27 20:22:49 jonny Exp $
#
# Suck in the configuration variables.
if [ -z "${source_rc_confs_defined}" ]; then
if [ -r /etc/defaults/rc.conf ]; then
. /etc/defaults/rc.conf
source_rc_confs
elif [ -r /etc/rc.conf ]; then
. /etc/rc.conf
fi
fi
case "$start_vinum" in
[Yy][Ee][Ss])
bak=/var/backups
rc=0
echo ""
echo "Backing up vinum status:"
if [ ! -f $bak/vinum.bak ]
then
echo "no $bak/vinum.bak"
vinum l > $bak/vinum.bak || rc=3
fi
vinum l > $bak/vinum.tmp || rc=2
if ! cmp -s $bak/vinum.tmp $bak/vinum.bak
then
[ $rc -lt 1 ] && rc=1
echo "$host vinum diffs:"
diff -u $bak/vinum.tmp $bak/vinum.bak
mv $bak/vinum.bak $bak/vinum.bak2
mv $bak/vinum.tmp $bak/vinum.bak
fi
;;
*) rc=0;;
esac
exit $rc
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030127202531.EFB214477C6>
