Re: Cleaning of $XDG_CACHE_HOME and $XDG_CACHE_HOME/thumbnails

Benjamin Berg <[email protected]>
Newsgroups gmane.linux.xdg.devel
Message-ID <[email protected]>
On Wed, 2020-02-26 at 10:25 -0300, Soni L. wrote:
> I use XDG_CACHE_HOME to store git repos. While it's definitely
> possible to nuke them to save space... it'll just re-fetch everything
> next time it runs.

I don't think that $XDG_CACHE_HOME is designed to be used directly by
users. And if it is an application which generates those repositories,
then again, it can just drop-in the appropriate configuration to
prevent cleaning.

The only reason I see right now for a user to store data in
$XDG_CACHE_HOME is if their backup system does not easily allow
excluding further directories. But that seems like a rather odd reason
for a user to put data into $XDG_CACHE_HOME.

Am I missing something obvious?

> Besides, what if you nuke it *while* the thing is running? That
> doesn't sound like a good idea.

This seems like a rather unlikely corner case. In particular as the
atime is taken into account by tmpfiles.d. So there should be no need
to worry about files being deleted that have been used in the last 30
days or so.

Benjamin

> On 2020-02-26 9:45 a.m., 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).
> > 
> > 
> > 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
> >       clients).
> >    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?
> > 
> > Benjamin
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > _______________________________________________
> > xdg mailing list
> > [email protected]
> > https://lists.freedesktop.org/mailman/listinfo/xdg
>  
> _______________________________________________
> xdg mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/xdg

_______________________________________________
xdg mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/xdg
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEED2NO4vMS33W8E4AFq6ZWhpmFY3AFAl5WdPsACgkQq6ZWhpmF
Y3B7bBAAzbH8nVXb1SgyzFWgU/7XL5mhpMnXdj4GnIPlOy+NBi+X6VXTX2uuqO2k
bGVXbwCldTKpqj2SAG156aybYK/D5GtPmjJSSUalMBhPSJf7egI8nZSFiI9BSe6q
oN59G/7m/J1Byy7/Vp7Cr2scO6P7VQ7VPvkkKFJLMrPcQ4NtOhQrRjjfuS0HXv8D
dIKlQ6otTleTx7bseq4HhdP6IRs51VPCIYtE0M/HoK+fgObWG4KHM2idlXkruMTS
5Y5nMN5jU+MJrssJ0xhvNu6nCeR4EJ339eFqNomapHEjEOP/6k+S06hDlExpeNwE
mOVLWV5nLO0unpuZ0jqDm64yt4Zd7xTHTMsR/swRkvLn69HDhbLhWkGE65joCzeu
DFPKHUHk2Lp7ZOeV6k/c7q0Y4l74yfJ7E0fj6YQNqanOn6i2J3uWMrEk4OWkcvpm
Rgk4oyGt3mQrImxdKVu7Gkt0ARQMwZX6Kwfm//nBM1whjxsdTn8xjMIhsnFpfXjh
SUDuoj1seJV+yqplWiugWIuytgkxUL6thxDWvgWrQFPKV8CFlt5hypx58SAFUQm+
TUvKea3D9/1wyRqX24Yz/wDT9P20csEmVU7MZXP78sMKWLLziFWG/ogxMOvQ6yim
ym59jxRIZSkOjjobeb0R7nulkoeLsfxbQIrU/moBHFKJP7LNWmA=
=YjrQ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.