转载一:http://uktar.blog.sohu.com/235500296.html
crontab中配置:每天3点定时执行那个脚本
* 3 * * * /usr/lighttpd-clear-log.sh
lighttpd-clear-log.sh : 删除指定目录、2天前、指定前缀的所有文件
#!/bin/bash
##clear log
find /var/log/lighttpd/access.* -mtime +2 -exec rm -f {} \;