centos 用久了,會產生很多evenlog
會佔用硬碟空間,這個語法可以秒歸零evenlog
ps 如果evenlog重要,記得先放到syslog機器上阿

千萬不要直接刪除logfile
rm -f /var/log/messages

正規作法檔案
cat /dev/null > logfile

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

網路上有sh 語法,可以參考。

文章標籤
全站熱搜
創作者介紹
創作者 snakeh 的頭像
snakeh

職場生涯小心得~

snakeh 發表在 痞客邦 留言(0) 人氣(5)