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/syslog
and /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.daily/logrotate
to /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.
- CCharles Hague @cghague2023-01-29 03:33:06.550Z
Hi Sandip - thanks for sharing this with us!
It appears that
logrotate
no longer depends oncron
and has been updated to usesystemd
timers instead. The script/etc/cron.daily/logrotate
still exists but now contains a check to see ifsystemd
is 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 linePersistent=true
, which means that if thelogrotate
timer 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.