tinypilot running out space because of log files
When I tried to update tinypilot today, I discovered that it had run out of space. Investigation showed that
/var/log/kern.log were about 7 gigs each.
The reason probably is that I only run tinypilot on a need basis, i.e. I don't leave it running all day. The default logrotate script runs using the
/etc/cron.daily/logrotate which runs at 6:25am every day only when I am not up :) So the logs never get rotated.
The solution for me was to move
/etc/cron.hourly/logrotate, so that even if my usage is more than an hour, there is a chance to rotate.
Given the use case that Tinypilot covers, this might be a good idea for the default setup of the system.
- 1 replies
Hi Sandip - thanks for sharing this with us!
It appears that
logrotateno longer depends on
cronand has been updated to use
systemdtimers instead. The script
/etc/cron.daily/logrotatestill exists but now contains a check to see if
systemdis active and, if it is, the script aborts.
The new configuration is located at
/etc/systemd/system/timers.target.wants/logrotate.timer. This file contains the line
Persistent=true, which means that if the
logrotatetimer is missed due to the system being powered off, it will instead be triggered when the system starts up. This means that your TinyPilot device should still have rotated the log files even if it was turned off overnight.
It sounds like you've already found a working solution, but if you'd like us to investigate further to see why your logs weren't being automatically rotated, please let me know.