NetBSD Problem Report #231

From gnats  Fri Apr 22 16:08:32 1994
Received: from post.demon.co.uk (post.demon.co.uk [158.152.1.72]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with SMTP id QAA10515 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Fri, 22 Apr 1994 16:08:01 -0700
Message-Id: <199404222043.VAA10586@allegory>
Date: Fri, 22 Apr 1994 21:43:54 +0100
From: Bob Kemp <rsk@allegory.demon.co.uk>
Reply-To: rsk@allegory.demon.co.uk
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: generalisation of /var/backups code in /etc/daily
X-Send-Pr-Version: 3.2

>Number:         231
>Category:       bin
>Synopsis:       generalisation of /var/backups code in /etc/daily
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 22 16:20:02 +0000 1994
>Closed-Date:    Wed Jun 15 04:28:01 +0000 1994
>Last-Modified:  
>Originator:     Bob Kemp
>Release:        -current 05Mar94
>Organization:
	Home PC
>Environment:

System: NetBSD allegory 0.9a ALLEGORY#0 i386


>Description:

	I find /var/backups very handy and used to add more test/copy
	lines for local files to /etc/daily but had to do it again
	after every upgrade.  This made me think that it would be
	handy to generalise the code in /etc/daily.  Below is a
	fairly simple shell script to do this.

	Please replace the code in /etc/daily with that below.  The new
	code is about 100 bytes larger but saves files with their
	full pathname.

>How-To-Repeat:
>Fix:

#!/bin/sh

bak=/var/backups

files="
	/usr/X386/lib/X11/Xconfig
	/etc/master.passwd
	/etc/Distfile
	/etc/hosts
	/etc/group
	/etc/aliases
	/etc/phones
	/etc/remote

	/usr/local/news/active 
	/usr/allegory/lib/slurp/slurp.sys 
	/usr/allegory/lib/slip/demon 
	/usr/allegory/lib/slip/compserv.login 
	/usr/allegory/lib/kermit/phones 
	/usr/allegory/lib/Phone-log 
	/usr/allegory/bin/mkbackup 
	/usr/allegory/bin/local 
"

for f in $files; do
	save=`echo $f | sed -e s,/,@,g `
	printf '%-38s' $f
	if [ -f $f ]; then
		if cmp -s $f $bak/$save; then
			printf ' unchanged'
		else
			printf ' saving ... '
			if [ -f $bak/$save ]; then
				save2=`echo $f | sed -e s,/,^,g `
				mv $bak/$save $bak/$save2
			fi
			cp -p $f $bak/$save
			printf 'done.'
		fi
	else
		printf '*** nonexistent or not a regular file ***'
	fi
	echo ''
done

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: cgd 
State-Changed-When: Tue Jun 14 21:28:01 PDT 1994 
State-Changed-Why:  
the new /etc/security script obsoletes this.  it uses /etc/changelist 
as a list of files to back up/check for changes. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.