#!/bin/csh -f
#
# elogwatch: run in background to watch for elogs and compress them as
# they are found. It looks for (*elog */*elog) from current directory.
#
# Runs forever until killed.
#
# To run:
#    cluster 1 elogwatch              [in its own window]
# or
#    cluster 1 elogwatch >& /dev/null &

while (1)
    set files=`ls *elog */*elog`
    if ($#files > 0) then
    	   cluster 1 -e compress $files
    	   echo Compressed: $files
    else
    	   sleep 60
    endif
end
