先申明一下,俺是新手~ubuntu用的菜
刚装了个ubuntu,但是等到折腾几下把常用软件和设置弄好系统居然莫名其妙减少了3G左右,最后查看是系统日志突然增大,kern.log和syslog居然就占了2.5左右,想把它删了,但又怕损坏系统,google了一下,有人说echo命令可以,sudo echo > /var/log/messages 但我输入之后终端总提示permission denied 没办法了,又没法安装其他软件了,,,求助!!!
怎么清除 ubuntu 8.04下/var/log 里面的 日志文件
-
- 帖子: 12
- 注册时间: 2009-10-17 22:18
怎么清除 ubuntu 8.04下/var/log 里面的 日志文件
ubuntu love
-
- 帖子: 111
- 注册时间: 2010-01-02 18:39
Re: 怎么清除 ubuntu 8.04下/var/log 里面的 日志文件
My name's tyro and u can call me wowoto instead.
- link_01
- 帖子: 1024
- 注册时间: 2008-11-05 13:24
Re: 怎么清除 ubuntu 8.04下/var/log 里面的 日志文件
不是有日志轮询
笔记
-------------------------------------
http://blog.163.com/wqt_1101
-------------------------------------
http://blog.163.com/wqt_1101
-
- 帖子: 12
- 注册时间: 2009-10-17 22:18
-
- 帖子: 12
- 注册时间: 2009-10-17 22:18
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
-
- 帖子: 12
- 注册时间: 2009-10-17 22:18
Re: 怎么清除 ubuntu 8.04下/var/log 里面的 日志文件
但是我现在linux分区一点空间都没有了……eexpress 写了:logrotate
系统会管理的。你别去动。
ubuntu love
-
- 帖子: 21
- 注册时间: 2009-05-16 13:41
- 系统: Archlinux
- 联系:
Re: 怎么清除 ubuntu 8.04下/var/log 里面的 日志文件
文章来源:http://www.ubuntu-tw.org/modules/newbb/ ... c_id=19126
這個說起來真的有點複雜,試著以簡單的方式來說明:
1. /var/log/ 下的 log files 是由 logrotate 管理的,在 /etc/cron.daily/ 中的 logrotate 排程在每天定時執行
這個檔案的內容很簡單如下:
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
所以 /etc/logrotate.conf 是一個很重要的設定檔案
另一個重要的目錄就是 /etc/logrotate.d/ 這個目錄,相關的 log files 資訊都在里面,如整理的期間,是否要壓縮.. 等,這個目錄中的設定在 /etc/logrotate.conf 中會被 include 進來做處理。
-----
要了解進一步資訊的,請 man logrotate 並參照著 /etc/logrotate.conf 及 /etc/logrotate.d/ 下面的檔案,可能就容易了解了。
這個說起來真的有點複雜,試著以簡單的方式來說明:
1. /var/log/ 下的 log files 是由 logrotate 管理的,在 /etc/cron.daily/ 中的 logrotate 排程在每天定時執行
這個檔案的內容很簡單如下:
#!/bin/sh
test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf
所以 /etc/logrotate.conf 是一個很重要的設定檔案
另一個重要的目錄就是 /etc/logrotate.d/ 這個目錄,相關的 log files 資訊都在里面,如整理的期間,是否要壓縮.. 等,這個目錄中的設定在 /etc/logrotate.conf 中會被 include 進來做處理。
-----
要了解進一步資訊的,請 man logrotate 並參照著 /etc/logrotate.conf 及 /etc/logrotate.d/ 下面的檔案,可能就容易了解了。
- photor
- 论坛版主
- 帖子: 11004
- 注册时间: 2008-04-26 12:41