這是我用來清空/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
arrow
arrow
    全站熱搜

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