#!/bin/sh


# Simple script to check the size of known offenders
# in the base initrd to keep from completely filling the FS

# WTMP
# /var/log/wtmp is the standard linux login() tracing file
# Modifications have been made to keep it from being written, 
# but if those are to fail, the below will keep the file size
# in check every 10 minutes.

WTMP_SIZE=32708

wtmp_size=$(stat -c %s wtmp)
if [ "$wtmp_size" -gt "$WTMP_SIZE" ]; then
    cat /dev/null > /var/log/wtmp
fi


# *.log
# /var/log/---.log is the standard logging location for 
# most open source applications. snmpd.log is one such example, 
# and these must be pruned. 

rm -rf /var/log/*.log







