mikshaw


Group: Members
Posts: 4856
Joined: July 2004 |
 |
Posted: May 21 2006,15:03 |
 |
You could script the rotation from /opt/bootlocal.sh at bootup, or /opt/powerdown.sh to do it at shutdown. Essentially you'd check the size of each log file, and if it reaches a given size you'd rename it. Something like this, maybe....
Code Sample | LOG_LIMIT=100000 #approx 100k for i in /var/log/{logfile1,logfile2,etc}; do LOG_SIZE=`ls -l $i | awk '{print $5}'` if [ $LOG_SIZE -gt $LOG_LIMIT ]; then OLD="$i.`date +%F`" mv $i $OLD touch $i fi done |
NOTICE: this is untested!
-------------- http://www.tldp.org/LDP/intro-linux/html/index.html
|