4 ms·
What I would love to see is an expiration mechanism for files, e.g. you create a file that will get cleaned up in an hour. Would simplify my life on multiple oc
by k_bx 6y ago
What I would love to see is an expiration mechanism for files, e.g. you create a file that will get cleaned up in an hour. Would simplify my life on multiple occasions.
- pferde 6y agoYou can with systemd (*cue boos from the audience*), although it involves a bit of additional configuration - what files to clean up, and set up a timer. See e.g. https://www.putorius.net/systemd-tmpfiles.html#user-specific-examples https://www.putorius.net/systemd-tmpfiles.html#user-specific... (no affiliation with the site, it was just the first one I found that describes the works).
- k_bx 5y agoWow, thank you! I didn't know it not only exists but is provided by systemd. I'm already using systemd to deploy my services, so this sounds like a perfect fit!
- loa_in_ 5y agoThat isn't something kernel should concern itself with. It also can be accomplished by three line python script and one line of crontab
- k_bx 5y agoTo me, this is the same concern that tmpfile api is providing. Either remove the temp file/dir api or extend it with useful stuff.
- loa_in_ 5y agotmpfile isn't guaranteed by Linux kernel. It's POSIX and POSIX is userspace layer with elements of it (like IPC and IO) implemented in kernel for efficiency resons.