Possible Logrotate issue with 10.2.3

I have noticed an issue with logrotate that may be related to the latest update. This will cause the log folder to fill up. You can see the space used in the Admin screen.

To check, run logrotate…

sudo /usr/sbin/logrotate -v /etc/logrotate.conf

If you see this error near the top…

error: Ignoring 00_defaults because the file owner is wrong (should be root or user with uid 0).

you have the issue.

I think this will fix that issue

sudo chown root:pi /opt/openenergymonitor/EmonScripts/defaults/etc/logrotate.d/*

but your logs may be too full for the rotate to happen.

df -h

will tell you how full /var/log/ is (or from the admin)

sudo du -a /var/log/* | sort -n -r | head -n 30

will tell which is the largest file.

sudo truncate -s 0 /var/log/emoncms/emoncms.log

should fix that, then try running log rotate again and check for errors.

1 Like

Touch -s. … not sure what that command is/does ?

My bad should be truncate - did it from memory.

Thanks, so that zeros it out. OK I see.

Yes without deleting it as sometimes log files are only created at startup so just deleting it can be an issue.

It might not be the largest file - check the output from the du command and modify as necessary.