+ -
当前位置:首页 → 问答吧 → archlinux如何删除日志

archlinux如何删除日志

时间:2009-01-06

来源:互联网

日志在那里?需要定期删除么?

作者: wuzi66832   发布时间: 2009-01-06

/var/log 大多数的日志都在这里.

fstab中加入
tmpfs /tmp tmpfs defaults,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,mode=1777 0 0
tmpfs /var/log tmpfs defaults,mode=0755,size=1M 0 0

这样每次关机都会删除本次开机产生的日志的,没必要那么烦,经常删除
就象windows我写个批处理,每次关机的时候删除日志一个道理
用上面的方法还更省资源.

作者: parset   发布时间: 2009-01-06

其实有时候我还是想把log留一段时间的..
出错了好有个参考..

作者: gsli52   发布时间: 2009-01-06

那样的话需要使用logrotate-3.7.7-3-i686.pkg.tar.gz
pacman logrotate
nano /etc/logroatate.conf
# 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

# Logs are moved into directory for rotation
# olddir /var/log/archive

# Ignore pacman saved files
tabooext + .pacorig .pacnew .pacsave

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

/var/log/wtmp {
monthly
create 0664 root root
rotate 1
}

作者: parset   发布时间: 2009-01-06

引用:
作者: parset
那样的话需要使用logrotate-3.7.7-3-i686.pkg.tar.gz
pacman logrotate
nano /etc/logroatate.conf
# 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

# Logs are moved into directory for rotation
# olddir /var/log/archive

# Ignore pacman saved files
tabooext + .pacorig .pacnew .pacsave

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

/var/log/wtmp {
monthly
create 0664 root root
rotate 1
}
刚刚发现我日志巨大。搜到这个,发现已经安装了,就是么有配置,顺手把日志大小限定为20m了。

作者: jobinson99   发布时间: 2010-03-04

sudo pacman -Rss syslogd

作者: kevinlei   发布时间: 2010-03-04