/var/tmp
没有在 POSIX 中定义,但是FHS 中定义:
5.15. /var/tmp : Temporary files preserved between system reboots
5.15.1. Purpose
The /var/tmp directory is made available for programs that
require temporary files or directories that are preserved between
system reboots. Therefore, data stored in /var/tmp is more
persistent than data in /tmp.
Files and directories located in /var/tmp must not be deleted
when the system is booted. Although data stored in /var/tmp is
typically deleted in a site-specific manner, it is recommended
that deletions occur at a less frequent interval than /tmp.
对于现实生活中的情况来说,这是一个非常困难的定义。包不使用/tmp
,因为由于某种原因,不应在重新启动时删除这些文件。
如果软件包无法清理,则其在/tmp
发行版/管理员中的残留物可以在重新启动时安全地清理。
我们应该何时以及如何清理/var/tmp
?软件包和软件开发人员可以期待什么/var/tmp
?
重启/var/tmp
后需要清理吗?n
(也可以看看如果 /var/tmp 位于临时文件系统上,会出现什么问题?和/tmp 和 /var/tmp 有什么区别?)