home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20110725.etc.tar.gz / bradford.20110725.etc.tar / etc / cron.daily / logrotate next >
Text File  |  2006-04-22  |  393b  |  18 lines

  1. #!/bin/sh
  2.  
  3. TMPF=`mktemp /tmp/logrotate.XXXXXXXXXX`
  4.  
  5. /usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF
  6. EXITVALUE=${PIPESTATUS[0]}
  7.  
  8. if [ $EXITVALUE != 0 ]; then
  9.     # wait a sec, we might just have restarted syslog
  10.     sleep 1
  11.     # tell what went wrong
  12.     /bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
  13.     /bin/logger -t logrotate -f $TMPF
  14. fi
  15.  
  16. rm -f $TMPF
  17. exit 0
  18.