3 ms·
There is still /var/tmp if you want a disk backed temporary file storage.
by NekkoDroid 2y ago
There is still /var/tmp if you want a disk backed temporary file storage.
- pantalaimon 2y agoBut is this also cleaned up on boot? The reason I’m doing this in /tmp is that I can just shut down the computer and have all those staging files gone. (Same reason I shut the computer down at the end of the day instead of suspend - I want to start with a clean slate the next day)
- NekkoDroid 2y agoIt isn't cleaned up at boot IIRC. Unless you leave your computer off for 30 days and then come back [1] :). But it shouldn't be too hard to write a relativly simple systemd.unit file that does that at boot. After all the main part would be `Requires/After=local-fs.target` and something like `ExecStart=bash -c 'rm -rf /var/tmp/*'` I think (you'd need to double check what exactly to do if you want to do this). [1] https://github.com/systemd/systemd/issues/33162 https://github.com/systemd/systemd/issues/33162
- rcxdude 2y agoThere's also systemd-tmpfiles for this exact purpose (well, it's a more general purpose create-a-directory-structure config system, but this is one of its usecases).