--------------------------------------------------------------
执行备份和清空当前使用的日志文件,clear_countlog.sh
zcatlinux, zcatlinux@yahoo.com.cn , 2004-06-28
---------------------------------------------------------------
#!/bin/bash
LOGFILE=/var/count.log
DATE=`date +%Y%m%d`
if [ -f $LOGFILE ]
then
cp $LOGFILE $LOGFILE-$DATE
find /var/ -ctime 3 -name count\* -exec rm {} \;
echo "" >$LOGFILE
fi
-------------------------------------------------
在crontab中实现每天执行以上脚本一次!
-------------------------------------------------
10 3 × × × root /home/clear_countlog.sh