I have just deployed a fix for /var/log
filling up on emonPi and emonBase users. To install the fix just run emonPi / emonBase update from admin page of local emoncms.
emonPi update will install a logrotate config that we developed with the help of @Paul for the previous emonSD image. This logrotate config was missed out of the latest image, hence this issue of /var/log filling up.
Here’s the contents of the update:
###################################################################################
# Install log rotate config
###################################################################################
echo "Installing emoncms logrotate..."
echo
# Remove already roated old log files to free up space incase /var/log is full
if ls /var/log/syslog.* > /dev/null 2>&1; then
sudo rm /var/log/syslog.*
fi
if ls /var/log/*.log.* > /dev/null 2>&1; then
sudo rm /var/log/*.log.*
fi
# Install emonPi log rotate config
sudo /var/www/emoncms/scripts/logger/install.sh
# Run log roate manually
echo "Running logrotate..."
sudo /usr/sbin/logrotate -v -s /var/log/logrotate/logrotate.status /etc/logrotate.conf > /dev/null 2>&1
Here’s the actual logrotate config that gets installed, unlike the default logrotate this config instructs logrotate to only store 2 rotations of log files and rotate each log after 1Mb. The update will run log rotate manually then after that logrotate will run periodically in the background to clean up logs.
Please report back if this fixes the issue for you.