- 论坛徽章:
- 0
|
本帖最后由 realcriss 于 2011-04-15 16:01 编辑
问题:
logrotated后,无法删除原始日志。 结果如下,包含压缩文件和原始文件了
我只想保留后的gz文件,不要源文件。- # ls -l log/
- total 485764
- -rw-r--r-- 1 root root 278890 Apr 15 15:04 access_log
- -rw-r--r-- 1 root root 472 Apr 15 15:01 access_log.1.gz
- -rw-r--r-- 1 root root 81915819 Apr 14 04:02 access_log.2
- -rw-r--r-- 1 root root 354 Apr 15 15:01 access_log.2.gz
- -rw-r--r-- 1 root root 79445349 Apr 13 04:02 access_log.3
- -rw-r--r-- 1 root root 41915 Apr 15 15:01 access_log.3.gz
复制代码 cat /etc/logrotate.conf- weekly
- rotate 4
- create
- include /etc/logrotate.d
- /var/log/wtmp {
- monthly
- minsize 1M
- create 0664 root utmp
- rotate 1
- }
复制代码 cat /etc/logrotate.d/httpd
- /etc/apache/logs/*_log {
- daily
- missingok
- rotate 7
- compress
- notifempty
- create 644 root root
- sharedscripts
- postrotate
- /sbin/service httpd reload > /dev/null 2>/dev/null
- endscript
- }
复制代码 |
|