Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 1997 13:56:00 -0800 (PST)
From:      John-Mark Gurney <jmg@nike.efn.org>
To:        FreeBSD Current <freebsd-current@freebsd.org>
Subject:   scsi-defect and /etc/daily
Message-ID:  <Pine.NEB.3.95.970204134810.29653F-200000@hydrogen.nike.efn.org>

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

[-- Attachment #1 --]
well...  after the discussion of adding something in /etc/daily about
checking scsi disks to see if they have grown new bad sectors I decided to
whip something up...  right now the script scsi-defect is called as defect
in my patch...    it probably should also be moved a little later... and
grouped with the disk checks...  just thought you guys might be
interested... ttyl...

John-Mark

gurney_j@efn.org
http://resnet.uoregon.edu/~gurney_j/
Modem/FAX: (541) 683-6954   (FreeBSD Box)

Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)


[-- Attachment #2 --]
Index: daily
===================================================================
RCS file: /usr/cvs/src/etc/daily,v
retrieving revision 1.21
diff -c -r1.21 daily
*** daily	1996/10/19 21:03:23	1.21
--- daily	1997/02/04 19:59:08
***************
*** 112,117 ****
--- 112,133 ----
  	fi
  fi
  
+ echo ""
+ echo "Cheacking SCSI disks:"
+ for i in `mount | awk -F/ 'substr($3, 1, 2) == "sd" { str=substr($3, 3); while (substr(str, 1, 1) >= "0" && substr(str, 1, 1) <= "9") { num=num+substr(str, 1, 1); str=substr(str, 2);} print num}' | sort -u`; do
+ 	glistfile=$bak/sd${i}.glist
+ 	if [ ! -f ${glistfile}.bak ] ; then
+ 		echo "no ${glistfile}.bak"
+ 		defect /dev/rsd${i}.ctl glist > ${glistfile}.bak
+ 	fi
+ 	defect /dev/rsd${i}.ctl glist > ${glistfile}
+ 	if cmp -s $glistfile ${glistfile}.bak ; then :; else
+ 		echo "/dev/sd$i defect list diff:"
+ 		diff ${glistfile}.bak $glistfile
+ 		mv ${glistfile}.bak ${glistfile}.bak2
+ 		cp -p $glistfile ${glistfile}.bak
+ 	fi
+ done
  
  # `calendar -a' needs to die. Why? Because it's a bad idea, particular
  # with networked home directories, but also in general.  If you want the

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.95.970204134810.29653F-200000>