监控安装 ERP

系统集成论坛

 找回密码
 注册通行证

QQ登录

只需一步,快速开始

路由器交换机防火墙系统集成商城 优质产品采购平台
查看: 1532|回复: 0
打印 上一主题 下一主题

如何清除Linux系统日志

[复制链接]
跳转到指定楼层
1
发表于 2011-3-27 22:23:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
华为金牌代理
  把下面的文件根据需要做一下修改,然后保存为clear_logs.sh,然后执行即可。
  #!/bin/sh
  cat /dev/null > /var/log/syslog
  cat /dev/null > /var/adm/sylog
  cat /dev/null > /var/log/wtmp
  cat /dev/null > /var/log/maillog
  cat /dev/null > /var/log/messages
  cat /dev/null > /var/log/openwebmail.log
  cat /dev/null > /var/log/maillog
  cat /dev/null > /var/log/secure
  cat /dev/null > /var/log/httpd/error_log
  cat /dev/null > /var/log/httpd/ssl_error_log
  cat /dev/null > /var/log/httpd/ssl_request_log
  cat /dev/null > /var/log/httpd/ssl_access_log
我分享,我成长!系统集成 XTJC.COM
您需要登录后才可以回帖 登录 | 注册通行证

本版积分规则

联系我们| 手机版|系统集成论坛 ( 京ICP备11008917号 )

GMT+8, 2024-10-6 20:40 , Processed in 0.117665 second(s), 25 queries .

系统集成论坛

BBS.XTJC.COM

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