如何删除系统日志

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
yuffey
帖子: 193
注册时间: 2007-09-06 16:24
来自: 中国上海

如何删除系统日志

#1

帖子 yuffey » 2008-03-06 11:23

Ubuntu使用久子,系统产生一大堆日志,请教各位达人,是如何删除这些日志得?
头像
yiding_he
帖子: 2677
注册时间: 2006-10-25 18:10
来自: 长沙
联系:

#2

帖子 yiding_he » 2008-03-06 11:59

我没有删除过日志,日志占不了多少空间的。看了看 /var/log 下面的文件,Linux 似乎会自动把这些日志打压缩包。要节省空间的话,删除这些压缩包应该就可以了。
你是自由的。别人也是。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#3

帖子 eexpress » 2008-03-06 13:03

man logrotate
这是系统日志的打包设置。可以修改的。
只是缺省的日志,不大的。
我曾经是需要把日志改大(保留的时效加长),才动过这个。
● 鸣学
yuffey
帖子: 193
注册时间: 2007-09-06 16:24
来自: 中国上海

#4

帖子 yuffey » 2008-03-06 13:26

很好很强大 ,但是
Normally, logrotate is run as a daily cron job. It will not modify a log more than once in one day unless the cri‐
terion for that log is based on the log’s size and logrotate is being run more than once each day, or unless the -f
or --force option is used.
基于这个原因,还是用

代码: 全选

cat /dev/null > syslog
cat /dev/null > message
cat /dev/null > kern.log
方便快捷。
eexpress 写了:man logrotate
这是系统日志的打包设置。可以修改的。
只是缺省的日志,不大的。
我曾经是需要把日志改大(保留的时效加长),才动过这个。
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#5

帖子 eexpress » 2008-03-06 13:30

啊。你搞极端的啊。天。
● 鸣学
头像
chattan
帖子: 3922
注册时间: 2007-07-11 20:59
联系:

#6

帖子 chattan » 2008-03-06 13:30

:D
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#7

帖子 BigSnake.NET » 2008-03-06 13:36

yuffey 写了:很好很强大 ,但是
Normally, logrotate is run as a daily cron job. It will not modify a log more than once in one day unless the cri‐
terion for that log is based on the log’s size and logrotate is being run more than once each day, or unless the -f
or --force option is used.
基于这个原因,还是用

代码: 全选

cat /dev/null > syslog
cat /dev/null > message
cat /dev/null > kern.log
方便快捷。
eexpress 写了:man logrotate
这是系统日志的打包设置。可以修改的。
只是缺省的日志,不大的。
我曾经是需要把日志改大(保留的时效加长),才动过这个。
清掉日志是不好的习惯
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
回复