|
|
Log in / Subscribe / Register

/tmp and /var/tmp

/tmp and /var/tmp

Posted Mar 30, 2011 19:49 UTC (Wed) by makomk (guest, #51493)
In reply to: /tmp and /var/tmp by dmarti
Parent article: Introducing /run

Putting /var/tmp/ is on a tmpfs not just a violation of the LSB filesystem layout requirements, it's likely to lead to data loss. /var/tmp/ is required to be preserved across reboots.


to post comments

/tmp and /var/tmp

Posted Mar 30, 2011 19:56 UTC (Wed) by dmarti (subscriber, #11625) [Link] (9 responses)

But it's allowed to be cleaned out, like any temp directory, right? I don't reboot often enough that a "tmpwatch" or cron job would run any less often than a reboot.

Any examples of programs that put something important in there?

/tmp and /var/tmp

Posted Mar 30, 2011 20:59 UTC (Wed) by nix (subscriber, #2304) [Link] (4 responses)

Original vi / nvi puts files in there for use by virecover. You really want those to still be there after e.g. a power cut.

(TBH I much prefer this over the vim habit of scattering .swp files everywhere. Emacs has a similar feature: you can drop all autosave files into a single directory without much effort.)

/tmp and /var/tmp

Posted Mar 30, 2011 21:18 UTC (Wed) by cortana (subscriber, #24596) [Link] (2 responses)

And for those who are wondering, you can set vim's 'directory' option to '/var/tmp' to get this behaviour back.

/tmp and /var/tmp

Posted Apr 1, 2011 17:28 UTC (Fri) by nix (subscriber, #2304) [Link] (1 responses)

Oo, thanks, hadn't noticed that. It doesn't record the pathname anywhere, though, so collisions are quite likely. (Emacs and XEmacs encode the pathname in the autosave filename.)

/tmp and /var/tmp

Posted Apr 1, 2011 19:13 UTC (Fri) by dtlin (subscriber, #36537) [Link]

:h dir
	- For Unix and Win32, if a directory ends in two path separators "//"
	  or "\\", the swap file name will be built from the complete path to
	  the file with all path separators substituted to percent '%' signs.
	  This will ensure file name uniqueness in the preserve directory.
(Same with 'bdir'.)

/tmp and /var/tmp

Posted Mar 31, 2011 12:38 UTC (Thu) by NAR (subscriber, #1313) [Link]

On the other hand if I edit a file on NFS from one computer, then vim can't use the /var/tmp from an other computer...

/tmp and /var/tmp

Posted Mar 30, 2011 21:06 UTC (Wed) by fritsd (guest, #43411) [Link]

Doesn't vi use /var/tmp for its crash-recovery files?

/tmp and /var/tmp

Posted Mar 30, 2011 21:12 UTC (Wed) by nybble41 (subscriber, #55106) [Link] (2 responses)

Tools like tmpwatch remove *old* temporary files; a reboot could potentially wipe out *recent* files which still contain needed data.

That said, I don't specifically know whether any common programs store data in /var/tmp which must persist across a reboot. I do know that MySQL occasionally stores certain temporary files there; these may be need for recovery after a crash or power interruption. KDE also stores cache files under /var/tmp; losing these at every reboot would be likely to negatively impact performance.

/tmp and /var/tmp

Posted Mar 31, 2011 0:02 UTC (Thu) by nicooo (guest, #69134) [Link]

Shouldn't they be using /var/cache?

/tmp and /var/tmp

Posted May 4, 2011 21:36 UTC (Wed) by nix (subscriber, #2304) [Link]

KDE rebuilds those cache files at every startup anyway.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds