這是我用來清空/var/log/httpd/底下log檔內容的Script檔。

#!/bin/bash

ls /var/log/httpd/ > /root/123.txt
while read line
do
     echo "" > "/var/log/httpd/$line"
     sleep 1
     echo "/var/log/httpd/$line log clear ok"


done < /root/123.txt
文章標籤
全站熱搜
創作者介紹
創作者 正義的胖虎 的頭像
正義的胖虎

胖虎的祕密基地

正義的胖虎 發表在 痞客邦 留言(0) 人氣(814)