Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Feb 2003 01:57:02 -0800 (PST)
From:      David Muir Sharnoff <muir@idiom.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   misc/48133: improvied vi recovery notification
Message-ID:  <200302100957.h1A9v2Z9054473@idiom.com>

next in thread | raw e-mail | index | archive | help

>Number:         48133
>Category:       misc
>Synopsis:       improvied vi recovery notification
>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 Feb 10 02:00:25 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     David Muir Sharnoff
>Release:        FreeBSD 4.7-RELEASE-p3 i386
>Organization:
Idiom
>Environment:
System: FreeBSD idiom.com 4.7-RELEASE-p3 FreeBSD 4.7-RELEASE-p3 #10: Wed Jan 8 14:13:35 PST 2003 muir@staid.idiom.com:/build/obj/build/src/sys/IDIOM i386


>Description:

	Ever reboot a system six times and get six notifications about
	a vi file that's available for recovery?

	Ever get notification too late 'cause you don't reboot that
	often?

>How-To-Repeat:
	
>Fix:

    In /etc/rc in the recovering files loop, add:
		
		if [ `expr "${i}" : '.*\.sent$'` -gt 0 ]; then
			continue
		fi

	and 

		mv "${i}" "${i}.sent"

	just after sendmail -t < "${i}"


    Add a new daily script that does the following:

	# Recover vi editor files.
	virecovery=`echo /var/tmp/vi.recover/recover.*`
	if [ "$virecovery" != '/var/tmp/vi.recover/recover.*' ]; then
		for i in $virecovery; do
			if [ `expr $i : '.*\.sent$'` -gt 0 ]; then
				continue
			fi
			virfn=`awk '/^X-vi-recover-path:/{print $2}' $i`
			if [ -r "$virfn" \
				-a `fstat "$virfn" | wc -l` -eq 1 \
				-a ! -x $i \
				-a -s $i \
				-a ! -e $i.sent \
			]; then
				sendmail -t < $i
				mv $i $i.sent
			fi
		done
	fi


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302100957.h1A9v2Z9054473>