# cat scrubdisks.sh
#!/bin/sh
#
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#
# WARNING: This script will destroy all data on the disk.
# USE AT YOUR OWN RISK
#
# scrubdisks.sh
# A shell script to scrub disks using a disk-list and a format command file
case $# in
0) echo “need more args\n Usage: $0 disklistfile log_dir
formatcmdfile” 1>&2; exit 2 ;;
1) echo “need more args\n Usage: $0 disklistfile log_dir
formatcmdfile” 1>&2; exit 2 ;;
2) echo “need more args\n Usage: $0 disklistfile log_dir
formatcmdfile” 1>&2; exit 2 ;;
esac
# Define the Disk List file
DISKLIST=$1
# Define where the logfiles directory is
LOGDIR=$2
# Define the location of the format command file
FMTCMD=$3
#
# Make the log directory
mkdir -p $LOGDIR
#
# Iterate through the disk list
for DISKS in `cat $DISKLIST`
do
# Run the format command and check the exit status
# to see if it worked correctly
if format -f $FMTCMD -l $LOGDIR/formatlog.$DISKS $DISKS; then
echo “format of disk $DISKS completed” >> /tmp/passedanalyze
else
echo “format of disk $DISKS failed” >> /tmp/failedanalyze
exit 2
fi
done
——————————————————————————————–
heeft twee input files nodig
c1.disks.list
analyzcmd
——————————————————————————————–
analyzcmd:
analyze
verify
quit
backup
quit
——————————————————————————————–
c1.disks.list:
c1t0d0
c1t1d0