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