No internet connection
  1. Home
  2. Technical Support

tinypilot running out space because of log files

By Sandip Bhattacharya @sandipb
    2023-01-27 21:59:30.340Z

    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.

    • 1 replies
    1. C

      Hi Sandip - thanks for sharing this with us!

      It appears that logrotate no longer depends on cron and has been updated to use systemd timers instead. The script /etc/cron.daily/logrotate still exists but now contains a check to see if systemd 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 line Persistent=true, which means that if the logrotate 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.