[plug] Rotating logs on a Workstation...

Bernd Felsche bernie at innovative.iinet.net.au
Thu Oct 2 12:34:00 WST 2003


On Thu, Oct 02, 2003 at 12:04:16PM +0800, Leon Brooks wrote:
> On Thu, 2 Oct 2003 08:27, Trevor Phillips wrote:
> > Any idea how it determines what's weekly, and what's daily, and why
> > this workstation doesn't have messages and a few others in either?
> 
> Mandrake does it in /etc/crontab, Debian is likely to have a /etc/cron.d 
> with files called daily, weekly etc in that which is "run-parts'ed" 
> from crontab. Here's the chunk out of my crontab:

SuSE runs it by script in /etc/cron.daily containing:
	/usr/sbin/logrotate /etc/logrotate.conf

/etc/logrotate.conf contains:
	# see "man logrotate" for details
	# rotate log files weekly
	weekly

	# keep 4 weeks worth of backlogs
	rotate 4

	# create new (empty) log files after rotating old ones
	create

	# uncomment this if you want your log files compressed
	compress

	# uncomment these to switch compression to bzip2
	#compresscmd /usr/bin/bzip2
	#uncompresscmd /usr/bin/bunzip2

	# RPM packages drop log rotation information into this directory
	include /etc/logrotate.d

	# no packages own wtmp -- we'll rotate them here
	/var/log/wtmp {
	    monthly
	    create 0664 root utmp
	    rotate 1
	}

	# system-specific logs may be also be configured here.

/etc/logrotate.d has
	total 72
	-rwxr-xr-x    1 root     root    213 2003-03-14 08:27 acct
	-rw-r--r--    1 root     root   1082 2003-03-14 10:26 apache
	-rw-r--r--    1 root     root    140 2003-03-14 10:28 fetchmail
	-rw-r--r--    1 root     root    558 2003-09-29 18:22 leafnode
	-rw-r--r--    1 root     root    277 2003-03-17 22:50 mgetty
	-rw-r--r--    1 root     root    695 2003-03-16 03:19 mysql
	-rw-r--r--    1 root     root    340 2003-05-23 20:23 privoxy
	-rw-r--r--    1 root     root    674 2003-03-18 05:10 radiusd
	-rw-r--r--    1 root     root    141 2003-03-14 08:32 rinetd
	-rw-r--r--    1 root     root    141 2003-03-17 22:52 rsync
	-rw-r--r--    1 root     root    439 2003-03-17 23:51 samba
	-rw-r--r--    1 root     root    642 2003-03-18 02:53 squid
	-rw-r--r--    1 root     root    584 2003-03-14 08:16 syslog
	-rw-r--r--    1 root     root    221 2003-03-16 03:04 ucdsnmp
	-rw-r--r--    1 root     root    349 2003-03-17 23:41 uucp
	-rw-r--r--    1 root     root    134 2003-03-14 08:23 wtmp
	-rw-r--r--    1 root     root    140 2003-03-17 21:28 xdm
	-rw-r--r--    1 root     root    134 2003-03-14 09:59 xntp

If all else fails:
	man logrotate
:-)

-- 
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ /  ASCII ribbon campaign | I'm a .signature virus!
 X   against HTML mail     | Copy me into your ~/.signature
/ \  and postings          | to help me spread!
_______________________________________________
plug mailing list
plug at plug.linux.org.au
http://mail.plug.linux.org.au/cgi-bin/mailman/listinfo/plug


More information about the plug mailing list