Cleaning of $XDG_CACHE_HOME and $XDG_CACHE_HOME/thumbnails

Bastien Nocera hadess at
Wed Feb 26 13:22:20 UTC 2020

On Wed, 2020-02-26 at 13:45 +0100, Benjamin Berg wrote:
> Hi,
> so I looked at gsd-housekeeping the other day. With systemd-
> tempfiles,
> it only has two purposes these days:
>  1. Cleaning $XDG_CACHE_HOME/thumbnails after 30 days
>  2. Cleaning the trash directories after a configurable time
> Currently it also tries to clean /tmp and /var/tmp, but doing so is
> really dangerous compared to just leaving it up to systemd-tempfiles
> (I
> have filed an MR to disable the logic if we are systemd booted).

That's fine.

> Now, systemd-tempfiles can already clean up everything except for the
> trash. And considering that $XDG_CACHE_HOME is non-essential by
> definition, I think it might be sane to use systemd-tempfiles not
> only
> to clean the thumbnails but the entirety of $XDG_CACHE_HOME in the
> future.

It's not "non-essential", it's a cache, which can be regenerated, but
it might be utterly costly to do so. Eg. there are 10 gigs of "cached"
evolution mails in my ~/.cache, 5 gigs of jhbuild builddirs.

Nuking it is a last ditch scenario. You'd avoid backing it up on space
constrained storage, but you'd want to avoid having to regenerate that
cache in most cases.

Is it reasonable to standardise on the systemd tmpfiles.d format?
> Is it OK to clean $XDG_CACHE_HOME after a fixed time period by
> default?

I'm guessing that's a no.

As for thumbnails, you'd probably get away with checking whether atime
is actually set on that mount and cleaning up the ones that haven't
been used.

> Other thoughts?
> Benjamin
> _______________________________________________
> xdg mailing list
> xdg at

More information about the xdg mailing list