#!/bin/csh
echo "This cleans up old directories that were not used."
echo "For questions or problems, contact David Ovens (ovens@atmos, 5-8108)."
echo ""
set enddate = `time-increment now i4 -7 0 "YYYYMMDD"`

cd ~wxdisc
foreach date (20??????)
  if (-d $date && $date <= $enddate) then
#    echo checking $date
    diff $date/links.html copythisdirectory/links.html >& /dev/null
    if ($status == 0) then
       ## might be untouched, see how many files are in the directory
       set nfiles = `ls -1 $date |wc -l`
       if ($nfiles == 1) then
          echo removing $date
	  /bin/rm -Rf $date
       endif
    endif
  endif
end
echo "All done."

