Bug 48133 - [patch] /etc/rc: improved vi recovery notification
Summary: [patch] /etc/rc: improved vi recovery notification
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 4.7-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-10 10:00 UTC by David Muir Sharnoff
Modified: 2017-12-31 22:36 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 David Muir Sharnoff 2003-02-10 10:00:25 UTC
	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?

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
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:35 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