#!/bin/sh

source /etc/profile

this_script="$(basename $0)"
echo $$ > /var/run/$this_script.pid

FILENAME=/var/log/wtmp
FILESIZE=0

# We are _so_ not important, make sure we don't steal CPU from _anybody_.
chrt -pi 0 $$ >/dev/null
renice -n 20 -p $$

while :; do     ## Forever, but not too often
    if [ -f "$FILENAME" ]
    then
        FILESIZE=$(stat -c%s "$FILENAME")
    fi

    if [ $FILESIZE -gt 102400 ]
    then
       echo `>$FILENAME`
    fi
    
    sleep 24h
done
