fsync on tmp is uniquely pointless since the contents are not intended to survive a normal restart let alone a system fault. Data loss in /tmp is OK and expected during a restart, for persistant data try /var/tmp
Posted Jun 5, 2012 12:34 UTC (Tue) by roblucid (subscriber, #48964)
[Link]
Unfortunately, one of the practical issues with /tmp being TMPFS based is the lack of consensus on the reboot semantics (UNIX & Linux). It was quite common in past for /tmp files only to be cleaned when older than 24hrs.
There was even debate in openSUSE's FATE, when it was proposed to default to the FHS behaviour and delete /tmp files by default (due to misfeature of old SuSE Linux automatic deletion needed to be explicitly turned on, which caused maintenance issues as developers who "knew" /tmp is automatically cleaned out, wouldn't ensure cleanup on process crashes and so on).
Temporary files: RAM or disk?
Posted Jun 5, 2012 15:40 UTC (Tue) by nybble41 (subscriber, #55106)
[Link]
> It was quite common in past for /tmp files only to be cleaned when older than 24hrs.
The distinction which I learned, which may very well be non-universal, was that /tmp is for temporary files which are tied to a particular process. These files can be removed as soon as the process exits, including on reboot. The /var/tmp directory is for temporary files which may need to outlast a given process, possibly across reboots, and should thus be cleared out much more sparingly based on the ages of the files.
Of course, not all processes follow this distinction.