• Cleaning up stale logs in Bookworm

    From bp@www.zefox.net@3:633/280.2 to All on Sun Sep 14 13:16:33 2025
    Summary: Is there a log-trimming utility in Bookworm?
    Keywords: log cleanup truncate

    Is there some utility that will truncate accumulated log
    file in Bookworm? I set up an 8GB microSD for a Pi2 and
    have ended up using it much longer than expected.

    It might not help, but a housecleaning utility seems like
    a good thing to know about in any case.

    Thanks for reading,

    bob prohaska


    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence =?iso-8859-13?q?D=FFOlivei@3:633/280.2 to All on Sun Sep 14 14:09:12 2025
    On Sun, 14 Sep 2025 03:16:33 -0000 (UTC), bp wrote:

    Is there some utility that will truncate accumulated log file in
    Bookworm?

    You can control this and other aspects of logfile usage via journald.conf <https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html>.

    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Chris Townley@3:633/280.2 to All on Sun Sep 14 17:52:12 2025
    On 14/09/2025 04:16, bp@www.zefox.net wrote:
    Is there some utility that will truncate accumulated log
    file in Bookworm? I set up an 8GB microSD for a Pi2 and
    have ended up using it much longer than expected.

    It might not help, but a housecleaning utility seems like
    a good thing to know about in any case.

    Thanks for reading,

    bob prohaska


    man logrotate ?

    --
    Chris

    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From The Natural Philosopher@3:633/280.2 to All on Sun Sep 14 18:22:39 2025
    On 14/09/2025 04:16, bp@www.zefox.net wrote:
    Is there some utility that will truncate accumulated log
    file in Bookworm? I set up an 8GB microSD for a Pi2 and
    have ended up using it much longer than expected.

    It might not help, but a housecleaning utility seems like
    a good thing to know about in any case.

    Thanks for reading,

    bob prohaska


    Umm.
    Are these old style logs or the dreaded systemd?

    I maintained a log/script of how to get the best out of a pi Zero and
    never ever write to its SD card...

    echo "tmpfs /var/ramlog tmpfs nodev,nosuid,noexec,nodiratime,size=25M
    0 0" >> /etc/fstab

    # /var/ramlog is used for everything except systemd. Logrotate keeps it
    tidy.
    # various entties that create log files have to be configured to dump
    stuff in it.

    ## fuck with shitsemd

    sed -i "s/#Storage=auto/Storage=volatile/" /etc/systemd/journald.conf
    sed -i "s/#RuntimeMaxUse=/RuntimeMaxUse=25M/" /etc/systemd/journald.conf
    sed -i "s/#ForwardToConsole=yes/ForwardToConsole=no/" /etc/systemd/journald.conf
    sed -i "s/#ForwardToWall=yes/ForwardToWall=no/" //etc/systemd/journald.conf

    #Using volatile storage puts it in /var/run/systemd and /var/run is
    created as a ram
    # based file system by the operating system

    Naturally systemd doesn't use logrotate. Wheels must be constantly reinvented, but RuntimeMaxUse=25M does most of what you want

    --
    "I guess a rattlesnake ain't risponsible fer bein' a rattlesnake, but ah
    puts mah heel on um jess the same if'n I catches him around mah chillun".



    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A little, after lunch (3:633/280.2@fidonet)
  • From bp@www.zefox.net@3:633/280.2 to All on Mon Sep 15 06:04:50 2025
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    Are these old style logs or the dreaded systemd?


    This is a systemd machine, but after looking around in response to
    suggestions made above it seems less than 5 MB is used by journals.
    That's not enough to matter.

    Evidently I've just added too many packages.

    Is there some way to coax the Add/Remove Programs application
    to list installed packages, ideally by size? Then I can clean
    house manually. The chromium browser will likely be the first
    to go 8-)

    Thanks to all for replying, and apologies for the misguided question!

    bob prohaska


    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Lawrence =?iso-8859-13?q?D=FFOlivei@3:633/280.2 to All on Mon Sep 15 07:25:18 2025
    On Sun, 14 Sep 2025 20:04:50 -0000 (UTC), bp wrote:

    Evidently I've just added too many packages.

    One occasional problem I had on my previous laptop was it would fill up
    the root partition every now and then with old cached package files. These
    are normally not needed after the package is actually installed.

    Check your disk usage for this cache with

    du -ks /var/cache/apt/archives/

    and see if it looks excessive. Anything you delete from there should be automatically downloadable again if itΓÇÖs needed. ;)

    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From bp@www.zefox.net@3:633/280.2 to All on Mon Sep 15 07:35:27 2025
    Lawrence DΓÇÖOliveiro <ldo@nz.invalid> wrote:
    On Sun, 14 Sep 2025 20:04:50 -0000 (UTC), bp wrote:

    Evidently I've just added too many packages.

    One occasional problem I had on my previous laptop was it would fill up
    the root partition every now and then with old cached package files. These are normally not needed after the package is actually installed.

    Check your disk usage for this cache with

    du -ks /var/cache/apt/archives/

    and see if it looks excessive. Anything you delete from there should be automatically downloadable again if itΓÇÖs needed. ;)

    Bingo! It's over one GB. Not my whole problem, but a big chunk of it.

    Thank you!

    bob prohaska


    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)
  • From Knute Johnson@3:633/280.2 to All on Mon Sep 15 07:37:25 2025
    On 9/14/25 15:04, bp@www.zefox.net wrote:
    The Natural Philosopher <tnp@invalid.invalid> wrote:
    Are these old style logs or the dreaded systemd?


    This is a systemd machine, but after looking around in response to suggestions made above it seems less than 5 MB is used by journals.
    That's not enough to matter.

    Evidently I've just added too many packages.

    Is there some way to coax the Add/Remove Programs application
    to list installed packages, ideally by size? Then I can clean
    house manually. The chromium browser will likely be the first
    to go 8-)

    Thanks to all for replying, and apologies for the misguided question!

    bob prohaska


    Edit /etc/systemd/journald.conf file to enable SystemMaxUse and set it
    equal to some value that will give you enough but not too much logs. I
    use 128M. If you have files building up in /var/log, every month I
    delete all the .gz archived logs. This is an example script:

    #!/bin/bash

    echo "delete-old-logs"

    rm -v /var/log/*.gz
    rm -v /var/log/apache2/*.gz
    rm -v /var/log/apt/*.gz
    rm -v /var/log/cups/*.gz
    rm -v /var/log/lightdm/*.gz
    rm -v /var/log/unattended-upgrades/*.gz

    Change or add to the list above according to you actual needs.

    8GB if you have a desktop installed is probably a little small for
    Bookworm. I tell my employer he needs to use a 16GB uSD for Bookworm
    with a desktop. 8GB was fine on Buster but just isn't enough any more.

    --

    Knute Johnson

    --- MBSE BBS v1.1.2 (Linux-x86_64)
    * Origin: A noiseless patient Spider (3:633/280.2@fidonet)