會員註冊 / 登入  |  電腦版  |  Jump to bottom of page

Web Server » 定期刪除/var/log/httpd下的log檔

發表人: andowson, 七段學員
2008-07-28 10:44:39
在/var/log/httpd目錄下可能包含一堆log檔,定期自動刪除可以空出更多硬碟空間,假設每個月執行一次,可以在/etc/crontab設定如下:

48 04 1 * * root find /var/log/httpd -name "*.log*" -atime +30 -type f -print0 | xargs -0 /bin/rm -f

其他目錄下的log檔也可比照辦理。




會員註冊 / 登入  |  電腦版  |  Jump to top of page