Cleaning of $XDG_CACHE_HOME and $XDG_CACHE_HOME/thumbnails

Benjamin Berg benjamin at
Wed Feb 26 12:45:42 UTC 2020


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).

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. So I am thinking that we could do the following:

   1. Specify that we use the systemd tmpfiles.d configuration format for
      cleaning $XDG_CACHE_HOME. Also specify that $XDG_CACHE_HOME will be
      cleaned automatically after e.g. 30 days unless otherwise configured
      by an application.
   2. Add some reference to this to the thumbnail specification.
   3. Tell application maintainers that they need to ship a configuration
      if they want to keep files longer (likely candidates are e.g. email
   4. As a start, add a "xdg-thumbnails.conf" systemd-tempfiles
      configuration to systemd that cleans $XDG_CACHE_HOME/thumbnails
      after 30 days.
   5. After a grace period, add "xdg-cache.conf" to clean $XDG_CACHE_HOME
      and remove "xdg-thumbnails.conf" again (similar to how
      /usr/lib/tmpfiles.d/tmp.conf does it for /var/tmp and /tmp)

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?
Other thoughts?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the xdg mailing list