-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tmpfiles: Support cleaning up only top-level directories, based on all timestamps within them #32674
Comments
This is a great idea. I'd consider expanding the request to making automatic deletion a bit more delicate in a number of respects.
|
There is already a more appropriate protocol via flock, as described in the manpage
That would be basically unpredictable and confusing. Just don't use temporary directories for things that you cannot afford to lose and recreate, that's what they are for |
Wait; you're saying "suspend laptop while on vacation; big job keeping working files in I'm also lost on your |
Yes, mostly because it's not real, it's just a made-up strawman for the sake of argumenting. If that was a real case, one can simply change the configuration to suit the particular situation, it's not really rocket science, it's a config file.
That's yet another imaginary situation. How do we know? Because it ignores that atime/ctime/mtime are all considered, so it's not real. Once again, please stop making things up, and provide real situations and real bugs. The titular issue shows a real use case and has merits. If it's not worth your time to actually try the things you are referencing, for real, then it's not worth our time to consider them. |
It is a very common idiom in scientific computing to use In deference to this established user base, I'd suggest some care be taken. Maybe creating a file |
Please spend at least some time to understand what you are talking about, you are proposing things that already exist, and have existed for more than 10 years. Just look at the manpage for the |
@barak @bluca Can we please not derail this issue with different feature requests? I can appreciate the additional features you're asking for, @barak, and I do think both of them are potentially reasonable and practical feature requests, but they aren't this feature request. Please file a separate feature request, so that this request doesn't become an amalgam of several different things, and so that each feature request can be evaluated separately and someone can write an implementation for it separately. |
Component
systemd-tmpfiles
Is your feature request related to a problem? Please describe
Cleaning up temporary files is useful. However, cleaning up individual temporary files on a file-by-file basis can be error-prone and hard to debug, by removing individual files within a directory tree based on the timestamps of that particular file.
Describe the solution you'd like
I would like to have an option/modifier character within the "Age" field of a tmpfiles.d entry to look at the timestamps of every file and directory under each top-level directory, and clean up the entire directory as a unit if and only if all files in it are older than the specified age.
For instance, with this modifier applied to
/tmp
and an age of 10d, tmpfiles would look at each top-level directory in/tmp
(e.g./tmp/abc
and/tmp/xyz
) as a unit. If a single file anywhere in/tmp/abc
is newer than 10d, tmpfiles will not touch anything in/tmp/abc
. If every file and directory in/tmp/xyz
is older than 10d, tmpfiles will remove the entire/tmp/xyz
directory recursively.This would treat directories as a whole as something that has value as a whole, rather than something that has value with individual files removed. It's much easier to debug "my entire temporary chroot dir got removed because it was old and unused" than it is to debug "a few scattered files got removed because those files hadn't been touched recently".
Describe alternatives you've considered
No response
The systemd version you checked that didn't have the feature you are asking for
256
The text was updated successfully, but these errors were encountered: