What goes in /var?
That description of /var
is self-contradictory. /var
contains things that are prone to change, such as websites, temporary files (/var/tmp
) and databases. The name is an abbreviation of "variable".
From man hier
, which has a "description of the filesystem hierarchy:"
/var
This directory contains files which may change in size, such as spool and log files.
/var/account
Process accounting logs (optional).
/var/adm
This directory is superseded by/var/log
and should be a symbolic link to/var/log
.
/var/backups
Reserved for historical reasons.
/var/cache
Data cached for programs.
/var/cache/fonts
Locally-generated fonts (optional).
/var/cache/man
Locally-formatted man pages (optional).
/var/cache/www
WWW proxy or cache data (optional).
/var/cache/<package>
Package specific cache data (optional).
/var/catman/cat[1-9]
or/var/cache/man/cat[1-9]
These directories contain preformatted manual pages according to their man page section. (The use of preformatted manual pages is deprecated.)
/var/crash
System crash dumps (optional).
/var/cron
Reserved for historical reasons.
/var/games
Variable game data (optional).
/var/lib
Variable state information for programs.
/var/lib/hwclock
State directory for hwclock (optional).
/var/lib/misc
Miscellaneous state data.
/var/lib/xdm
X display manager variable data (optional).
/var/lib/<editor>
Editor backup files and state (optional).
/var/lib/<name>
These directories must be used for all distribution packaging support.
/var/lib/<package>
State data for packages and subsystems (optional).
/var/lib/<pkgtool>
Packaging support files (optional).
/var/local
Variable data for /usr/local.
/var/lock
Lock files are placed in this directory. The naming convention for device lock files isLCK..<device>
where<device>
is the device's name in the filesystem. The format used is that of HDU UUCP lock files, that is, lock files contain a PID as a 10-byte ASCII decimal number, followed by a newline character.
/var/log
Miscellaneous log files.
/var/opt
Variable data for/opt
.
/var/mail
Users' mailboxes. Replaces/var/spool/mail
.
/var/msgs
Reserved for historical reasons.
/var/preserve
Reserved for historical reasons.
/var/run
Run-time variable files, like files holding process identifiers (PIDs) and logged user information (utmp). Files in this directory are usually cleared when the system boots.
/var/spool
Spooled (or queued) files for various programs.
/var/spool
Spooled (or queued) files for various programs.
/var/spool/at
Spooled jobs forat(1)
.
/var/spool/cron
Spooled jobs forcron(8)
.
/var/spool/lpd
Spooled files for printing (optional).
/var/spool/lpd/printer
Spools for a specific printer (optional).
/var/spool/mail
Replaced by /var/mail.
/var/spool/mqueue
Queued outgoing mail (optional).
/var/spool/news
Spool directory for news (optional).
/var/spool/rwho
Spooled files forrwhod(8)
(optional).
/var/spool/smail
Spooled files for thesmail(1)
mail delivery program.
/var/spool/uucp
Spooled files foruucp(1)
(optional).
/var/tmp
Like /tmp, this directory holds temporary files stored for an unspecified duration.
/var/yp
Database files for NIS, formerly known as the Sun Yellow Pages (YP).