如何清理日志?
1,使用rm -f /xx/xx/xx.log,2,
2,使用腳本
根據文件需要,寫一下腳本 將對應的文件導出至null文件中
!/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
3,使用腳本
!/bin/sh
rm -f /xx/xx.log
rm -f /xx1/xx.log
rm -f /xx2/xx.log
rm -f /xx2/xx1.log
總結
- 上一篇: 面向对象方法总结
- 下一篇: 开发管理 CheckLists(1) -