/var/tmp
is not defined in POSIX, but is defined in 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.
This is a very difficult definition for real life situations.
A package does not use /tmp
, because the files should not be deleted on reboot for some reason.
If a package fails to cleanup its remains in /tmp
the distribution/admin can safely clean at reboot.
When and how should we clean up /var/tmp
? What can packages and software developers expect from /var/tmp
?
Do we have to clean /var/tmp
after n
reboots?
(see also What can go wrong if /var/tmp is on a temporary filesystem? and What is the difference between /tmp and /var/tmp?)
n
reboots violates FHS and introduces an uncertainty to applications as to when their files will not be preserved. Perhaps something based onfind /var/tmp/ -mtime +30
will be more consistent.Files and directories located in /var/tmp must not be deleted when the system is booted.
And who knows that a reboot is more often than once in 30 days?