1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 <refentry id="systemd-tmpfiles"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
28 <title>systemd-tmpfiles</title>
29 <productname>systemd</productname>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
42 <refentrytitle>systemd-tmpfiles</refentrytitle>
43 <manvolnum>8</manvolnum>
47 <refname>systemd-tmpfiles</refname>
48 <refname>systemd-tmpfiles-setup.service</refname>
49 <refname>systemd-tmpfiles-setup-dev.service</refname>
50 <refname>systemd-tmpfiles-clean.service</refname>
51 <refname>systemd-tmpfiles-clean.timer</refname>
52 <refpurpose>Creates, deletes and cleans up volatile
53 and temporary files and directories</refpurpose>
58 <command>systemd-tmpfiles</command>
59 <arg choice="opt" rep="repeat">OPTIONS</arg>
60 <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
63 <para><filename>systemd-tmpfiles-setup.service</filename></para>
64 <para><filename>systemd-tmpfiles-setup-dev.service</filename></para>
65 <para><filename>systemd-tmpfiles-clean.service</filename></para>
66 <para><filename>systemd-tmpfiles-clean.timer</filename></para>
70 <title>Description</title>
72 <para><command>systemd-tmpfiles</command> creates,
73 deletes, and cleans up volatile and temporary files and
74 directories, based on the configuration file format and
76 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
79 <para>If invoked with no arguments, it applies all
80 directives from all configuration files. If one or
81 more filenames are passed on the command line, only
82 the directives in these files are applied. If only
83 the basename of a configuration file is specified,
84 all configuration directories as specified in
85 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
86 are searched for a matching file.</para>
90 <title>Options</title>
92 <para>The following options are understood:</para>
96 <term><option>--create</option></term>
97 <listitem><para>If this option is
98 passed, all files and directories
99 marked with <varname>f</varname>,
100 <varname>F</varname>,
101 <varname>w</varname>,
102 <varname>d</varname>,
103 <varname>D</varname>,
104 <varname>p</varname>,
105 <varname>L</varname>,
106 <varname>c</varname>,
107 <varname>b</varname>,
108 <varname>m</varname> in the
109 configuration files are created or
110 written to. Files and directories
111 marked with <varname>z</varname>,
112 <varname>Z</varname>,
113 <varname>m</varname> have their
114 ownership, access mode and security
115 labels set. </para></listitem>
119 <term><option>--clean</option></term>
120 <listitem><para>If this option is
121 passed, all files and directories with
122 an age parameter configured will be
123 cleaned up.</para></listitem>
127 <term><option>--remove</option></term>
128 <listitem><para>If this option is
129 passed, all files and directories
130 marked with <varname>r</varname>,
131 <varname>R</varname> in the
132 configuration files are
133 removed.</para></listitem>
136 <term><option>--boot</option></term>
137 <listitem><para>Also execute lines
138 with an exclamation mark.
142 <term><option>--prefix=<replaceable>path</replaceable></option></term>
143 <listitem><para>Only apply rules that
144 apply to paths with the specified
145 prefix. This option can be specified
146 multiple times.</para></listitem>
149 <term><option>--exclude-prefix=<replaceable>path</replaceable></option></term>
150 <listitem><para>Ignore rules that
151 apply to paths with the specified
152 prefix. This option can be specified
153 multiple times.</para></listitem>
156 <term><option>--root=<replaceable>root</replaceable></option></term>
157 <listitem><para>Takes a directory path
158 as an argument. All paths will be
159 prefixed with the given alternate <replaceable>root</replaceable>
160 path, including config search paths.
164 <xi:include href="standard-options.xml" xpointer="help" />
165 <xi:include href="standard-options.xml" xpointer="version" />
168 <para>It is possible to combine
169 <option>--create</option>, <option>--clean</option>,
170 and <option>--remove</option> in one invocation. For
171 example, during boot the following command line is
172 executed to ensure that all temporary and volatile
173 directories are removed and created according to the
174 configuration file:</para>
176 <programlisting>systemd-tmpfiles --remove --create</programlisting>
181 <title>Exit status</title>
183 <para>On success, 0 is returned, a non-zero failure
184 code otherwise.</para>
188 <title>See Also</title>
190 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
191 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>