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我写个批处理,每次关机的时候删除日志一个道理
用上面的方法还更省资源.
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
}
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 } |
作者: jobinson99 发布时间: 2010-03-04
sudo pacman -Rss syslogd
作者: kevinlei 发布时间: 2010-03-04
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28