File: cron.weekly

package info (click to toggle)
sysklogd 1.3-31
  • links: PTS
  • area: main
  • in suites: slink
  • size: 404 kB
  • ctags: 265
  • sloc: ansic: 3,697; perl: 158; makefile: 143; sh: 139
file content (33 lines) | stat: -rw-r--r-- 781 bytes parent folder | download | duplicates (3)
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
32
33
#! /bin/sh

# sysklogd	Cron script to rotate system log files weekly.
#
#		If you want to rotate logfiles daily, edit
#		this script and /etc/cron.daily/sysklogd to get
#		the logfiles in sync (they must not occur in both
#		files).  Do not delete this file itself, since
#		it will then be replaced after an upgrade creating
#		unwanted effects.
#
#		Written by Ian A. Murdock <imurdock@debian.org>.
#		$Id: cron.weekly,v 1.2 1998/01/02 03:07:22 joey Exp $

cd /var/log
for LOG in `syslogd-listfiles --weekly`
do
   if [ -f $LOG ]; then
      savelog -g adm -m 640 -u root -c 4 $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