Listing 4.          bkpchk

#!/bin/ksh
cd
for i in `ls backups/*err 2>/dev/null` ; do
  size=`ls -l $i|awk '{print $5}'`
  if [ $size -ne 0 -a $size -ne 181 ]; then
    echo 'The backup error-file' $i
    echo ' shows unusual errors.'
    echo ' This may indicate one or more files'
    echo ' not being backed up.  Please investigate:'
    cat $i
    echo 'Do you want to suppress further'
    echo 'notification of this error(y/n)? \c'
    read reply
    if [ "$reply" = "y" ]; then mv $i $i.sav; fi
  fi
done
