#! /bin/sh

# sysklogd	Cron script to rotate system log files daily.
#
#		If you want to rotate other logfiles daily, edit
#		this script.  An easy way is to add them manually
#		or to add -a to syslogd-listfiles and add some grep
#		stuff
#
#		Written by Martin Schulze <joey@debian.org>.
#		$Id: cron.daily,v 1.2 1998/01/02 03:07:21 joey Exp $

cd /var/log
for LOG in `syslogd-listfiles`
do
   if [ -f $LOG ]; then
      savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null
   fi
done

for LOG in `syslogd-listfiles --auth`
do
   if [ -f $LOG ]; then
      chown root.adm $LOG
      chmod o-rwx $LOG
   fi
done

# Restart syslogd
#
/etc/init.d/sysklogd reload
