summaryrefslogtreecommitdiff
blob: 073a721f37137b7eb16c6bb13ae52bf0622f80ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#! /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: syslog-cron,v 1.3 2002/12/16 16:55:47 woodchip Exp $

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

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

# Restart syslogd
#
/bin/killall -HUP syslogd