invoking write from cron $W could not be reached

Scott Blachowicz scott at grlab.UUCP
Tue May 2 03:27:17 AEST 1989


Another thing that can work depending on what you're trying to accomplish
is to use the wall program. I don't know what versions of UN*X this is
supported on, but on ours (HP-UX), you can specify a group name to
receive a broadcast message. I've got a script setup that checks for
available free space on different file systems. If it gets below a
threshold value for that file system a message is sent to the group
'sys'. I just add the regular logins for the people able to check for
and reclaim disc space to the 'sys' group. The script looks like this:

   #! /bin/sh
   if [ -z "$1" ]
   then tolerance=20000
   else
      tolerance=$1
      shift
   fi
   df_output=`df $* |
              sed 's/[()]/ /g' |
              awk '{if ($4 <= '$tolerance') {print}}'`
   if [ ! -z "$df_output" ]
   then
      ( uname -a ; echo "$df_output" ) | /etc/wall -g sys
      ( uname -a ; echo "$df_output" ) | remsh other_sys "/etc/wall -g sys"
   fi
---
Scott Blachowicz
USPS:  Graphicus                UUCP:    ...!hpubvwa!grlab!scott
       150 Lake Str S, #206     VoicePh: 206/828-4691
       Kirkland, WA 98033       FAX:     206/828-4236



More information about the Comp.unix.wizards mailing list