I noticed that with every boot the content of /tmp is deleted.
I s this a bug or a feature?
what would be the “appropriate” alternative for storing temporary files?
I noticed that with every boot the content of /tmp is deleted.
I s this a bug or a feature?
what would be the “appropriate” alternative for storing temporary files?
Do you use btrfs?
Have you set up the journal persistance?
It is a feature. It was always the intention of /tmp in Unix that the contents was deleted on boot.
When it would not be, it would grow until full because many applications store files there and then forget to delete them when they stop running.
In my systems I have /tmp as a tmpfs file system, thus it is derstroyed at shut down (and thus empty after recreation at boot).
You probably have the same (think it is an installation default since already many years). You can check with mount | grep '/tmp'.
Well, the definition of a “temporary file” in Unix/Linux is a file that will at maximum live until the system shuts down Thus /tmp is a very proper place for them… You may mean something different, but then you have to explain what sort of file existence you mean.
Probably /var/tmp, I guess.