|
发表于 2003-3-7 16:24:36
|
显示全部楼层
2003年03月07日下午16时18分19秒[root@www root]# rpm -qf /etc/logrotate.d
logrotate-3.6.4-1
2003年03月07日下午16时21分28秒[root@www root]# rpm -qi logrotate-3.6.4-1
Name : logrotate Relocations: (not relocateable)
Version : 3.6.4 Vendor: Red Hat, Inc.
Release : 1 Build Date: 2002年04月16日 星期二 04时27分50秒
Install date: 2002年05月08日 星期三 18时27分02秒 Build Host: porky.devel.redhat.com
Group : System Environment/Base Source RPM: logrotate-3.6.4-1.src.rpm
Size : 42260 License: GPL
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary : Rotates, compresses, removes and mails system log files.
Description :
The logrotate utility is designed to simplify the administration of
log files on a system which generates a lot of log files. Logrotate
allows for the automatic rotation compression, removal, and mailing of
log files. Logrotate can be set to handle a log file daily, weekly,
monthly, or when the log file gets to a certain size . Normally,
logrotate runs as a daily cron job.
2003年03月07日下午16时17分26秒[root@www root]# cat /etc/logrotate.d/apache
/var/log/httpd/access_log /var/log/httpd/agent_log /var/log/httpd/error_log /var/log/httpd/referer_log {
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true
endscript
}
2003年03月07日下午16时17分28秒[root@www root]# rpm -qf /etc/logrotate.d/apache
apache-1.3.27-2
至于如何“周期性”地删除,可以参考:
2003年03月07日下午16时18分18秒[root@www root]# cat /etc/logrotate.d/squid
/var/log/squid/access.log {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
}
/var/log/squid/cache.log {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
}
/var/log/squid/store.log {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
# This script asks squid to rotate its logs on its own.
# Restarting squid is a long process and it is not worth
# doing it just to rotate logs
postrotate
/usr/sbin/squid -k rotate
endscript
}
|
|