3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5 This file is part of systemd.
7 Copyright 2010 Brandon Philips
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 <refentry id="tmpfiles.d">
25 <title>tmpfiles.d</title>
26 <productname>systemd</productname>
30 <contrib>Documentation</contrib>
31 <firstname>Brandon</firstname>
32 <surname>Philips</surname>
33 <email>brandon@ifup.org</email>
39 <refentrytitle>tmpfiles.d</refentrytitle>
40 <manvolnum>5</manvolnum>
44 <refname>tmpfiles.d</refname>
45 <refpurpose>configuration for creation, deletion and cleaning of tmpfiles</refpurpose>
49 <title>Description</title>
51 <para><command>systemd</command> uses <filename>/etc/tmpfiles.d/</filename> to describe the creation, cleaning and removal of temporary files and directories
52 which usually reside in <filename>/var/run</filename> or <filename>/tmp</filename>).
53 Each configuration file is named in the style of
54 <filename>/etc/tmpfiles.d/<program>.conf</filename></para>
59 <title>Configuration Format</title>
61 <para>The configuration format is one line per path containing
62 action, mode, ownership and age fields:</para>
64 <programlisting>type path mode uid gid age
65 d /var/run/user 0755 root root 10d
72 <term><varname>f</varname></term>
73 <listitem><para>create a file</para></listitem>
77 <term><varname>F</varname></term>
78 <listitem><para>truncate a file</para></listitem>
82 <term><varname>d</varname></term>
83 <listitem><para>create a directory</para></listitem>
87 <term><varname>D</varname></term>
88 <listitem><para>truncate a directory</para></listitem>
92 <term><varname>x</varname></term>
93 <listitem><para>ignore the path</para></listitem>
97 <term><varname>r</varname></term>
98 <listitem><para>remove the path</para></listitem>
102 <term><varname>R</varname></term>
103 <listitem><para>recursively remove the path</para></listitem>
110 <para>The date field, when set, is used to decide what files to delete when cleaning. If a file or directory is older than the current time minus the age field it is deleted. The field format is an integer followed by one of the following postfixes:</para>
112 <varlistentry><term><varname>sec</varname></term>
113 <term><varname>s</varname></term>
114 <term><varname>min</varname></term>
115 <term><varname>hr</varname></term>
116 <term><varname>h</varname></term>
117 <term><varname>d</varname></term>
118 <term><varname>w</varname></term>
119 <term><varname>msec</varname></term>
120 <term><varname>ms</varname></term>
121 <term><varname>m</varname></term>
122 <term><varname>usec</varname></term>
123 <term><varname>us</varname></term></varlistentry>
131 <title>Example</title>
133 <title>/etc/tmpfiles.d/screen.conf example</title>
134 <para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para>
136 <programlisting>d /var/run/screens 1777 root root 10d
137 d /var/run/uscreens 0755 root root 10d
143 <title>See Also</title>
145 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>