To the best of my knowledge
/tmp is cleared on every boot, since it normally uses
tmpfs, which basically is RAM.
During development of ML applications I often need a tmp directory for debugging and other stuff that does not fill up my RAM, but is stored on hard disk. At the moment my scripts automatically clear these directories, but this is not the best solution: sometimes I forget to invoke a cleanup, sometimes the script cleans up too early, and so on...
Is there already some tmp directory that gets cleaned on every bootup on hard disk? If not, what would be the easiest way to create such an directory and ensure it is cleaned on every boot?
EDIT: I am using Manjaro (Arch Linux) on kernel 4.14 with i3wm.
/tmpthen will be a lot slower, right? I mean this way I would change the behavior for every application that uses
/tmp, not just for my development process?!
/var/tmpis also cleared on every boot and there is no problem when users write tmp files in there? (note: I have added distribution information now)