Bug 47566 - [vinum] [patch] add vinum status verification to periodic scripts
Summary: [vinum] [patch] add vinum status verification to periodic scripts
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 4.7-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-27 20:30 UTC by Joao Carlos Mendes Luis
Modified: 2017-12-31 22:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joao Carlos Mendes Luis 2003-01-27 20:30:02 UTC
Currently vinum does not send any reports by email.  This script, to be
used in daily periodic checks for differences in vinum status.

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
Comment 1 Kris Kennaway freebsd_committer 2003-07-14 11:17:04 UTC
Responsible Changed
From-To: freebsd-bugs->grog

Assign to vinum author
Comment 2 Andy Farkas 2003-07-14 14:50:13 UTC
On Mon, 14 Jul 2003, Kris Kennaway wrote:

> Responsible-Changed-From-To: freebsd-bugs->grog
> Responsible-Changed-By: kris
> Responsible-Changed-When: Mon Jul 14 03:17:04 PDT 2003
> Responsible-Changed-Why:
> Assign to vinum author
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=47566

I like this patch and have been using it for a couple of months on a few
boxes. I have seen it report actual vinum errors which helped diagnose
problems on a box that was playing up here.

There is one error, the diff is backwards:

@@ -33,7 +33,7 @@
         then
             [ $rc -lt 1 ] && rc=1
             echo "$host vinum diffs:"
-            diff -u $bak/vinum.tmp $bak/vinum.bak
+            diff -u $bak/vinum.bak $bak/vinum.tmp
             mv $bak/vinum.bak $bak/vinum.bak2
             mv $bak/vinum.tmp $bak/vinum.bak
         fi


--

 :{ andyf@speednet.com.au

        Andy Farkas
    System Administrator
   Speednet Communications
 http://www.speednet.com.au/
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2004-09-09 20:17:52 UTC
Responsible Changed
From-To: grog->le

With permission of both, reassign from grog to le.
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2008-05-19 20:55:17 UTC
Responsible Changed
From-To: le->freebsd-bugs

With bugmeister hat on, reassign as le@ has not been active in a while.
Comment 5 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:44 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped