LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1292|回复: 5

archlinux如何删除日志

[复制链接]
发表于 2009-1-6 08:31:56 | 显示全部楼层 |阅读模式
日志在那里?需要定期删除么?
发表于 2009-1-6 08:52:08 | 显示全部楼层
/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我写个批处理,每次关机的时候删除日志一个道理
用上面的方法还更省资源.
回复 支持 反对

使用道具 举报

发表于 2009-1-6 10:58:54 | 显示全部楼层
其实有时候我还是想把log留一段时间的..
出错了好有个参考..
回复 支持 反对

使用道具 举报

发表于 2009-1-6 12:46:17 | 显示全部楼层
那样的话需要使用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
}
回复 支持 反对

使用道具 举报

发表于 2010-3-3 23:13:15 | 显示全部楼层
Post by parset;1934765
那样的话需要使用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了。
回复 支持 反对

使用道具 举报

发表于 2010-3-4 11:18:06 | 显示全部楼层
sudo pacman -Rss syslogd
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表