]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-tmpfiles.xml
Merge pull request #7356 from keszybz/cgroup-and-manager-cleanups
[thirdparty/systemd.git] / man / systemd-tmpfiles.xml
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">
4
5 <!--
6 This file is part of systemd.
7
8 Copyright 2010 Lennart Poettering
9
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.
14
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.
19
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/>.
22 -->
23
24 <refentry id="systemd-tmpfiles"
25 xmlns:xi="http://www.w3.org/2001/XInclude">
26
27 <refentryinfo>
28 <title>systemd-tmpfiles</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd-tmpfiles</refentrytitle>
43 <manvolnum>8</manvolnum>
44 </refmeta>
45
46 <refnamediv>
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>
54 </refnamediv>
55
56 <refsynopsisdiv>
57 <cmdsynopsis>
58 <command>systemd-tmpfiles</command>
59 <arg choice="opt" rep="repeat">OPTIONS</arg>
60 <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
61 </cmdsynopsis>
62
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>
67 </refsynopsisdiv>
68
69 <refsect1>
70 <title>Description</title>
71
72 <para><command>systemd-tmpfiles</command> creates, deletes, and
73 cleans up volatile and temporary files and directories, based on
74 the configuration file format and location specified in
75 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
76 </para>
77
78 <para>If invoked with no arguments, it applies all directives from all configuration
79 files. If one or more absolute filenames are passed on the command line, only the
80 directives in these files are applied. If <literal>-</literal> is specified instead
81 of a filename, directives are read from standard input. If only the basename of a
82 configuration file is specified, all configuration directories as specified in
83 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
84 are searched for a matching file.</para>
85 </refsect1>
86
87 <refsect1>
88 <title>Options</title>
89
90 <para>The following options are understood:</para>
91
92 <variablelist>
93 <varlistentry>
94 <term><option>--create</option></term>
95 <listitem><para>If this option is passed, all files and
96 directories marked with
97 <varname>f</varname>,
98 <varname>F</varname>,
99 <varname>w</varname>,
100 <varname>d</varname>,
101 <varname>D</varname>,
102 <varname>v</varname>,
103 <varname>p</varname>,
104 <varname>L</varname>,
105 <varname>c</varname>,
106 <varname>b</varname>,
107 <varname>m</varname>
108 in the configuration files are created or written to. Files
109 and directories marked with
110 <varname>z</varname>,
111 <varname>Z</varname>,
112 <varname>t</varname>,
113 <varname>T</varname>,
114 <varname>a</varname>, and
115 <varname>A</varname> have their ownership, access mode and
116 security labels set. </para></listitem>
117 </varlistentry>
118
119 <varlistentry>
120 <term><option>--clean</option></term>
121 <listitem><para>If this option is passed, all files and
122 directories with an age parameter configured will be cleaned
123 up.</para></listitem>
124 </varlistentry>
125
126 <varlistentry>
127 <term><option>--remove</option></term>
128 <listitem><para>If this option is passed, the contents of
129 directories marked with <varname>D</varname> or
130 <varname>R</varname>, and files or directories themselves
131 marked with <varname>r</varname> or <varname>R</varname> are
132 removed.</para></listitem>
133 </varlistentry>
134 <varlistentry>
135 <term><option>--boot</option></term>
136 <listitem><para>Also execute lines with an exclamation mark.
137 </para></listitem>
138 </varlistentry>
139 <varlistentry>
140 <term><option>--prefix=<replaceable>path</replaceable></option></term>
141 <listitem><para>Only apply rules with paths that start with
142 the specified prefix. This option can be specified multiple
143 times.</para></listitem>
144 </varlistentry>
145 <varlistentry>
146 <term><option>--exclude-prefix=<replaceable>path</replaceable></option></term>
147 <listitem><para>Ignore rules with paths that start with the
148 specified prefix. This option can be specified multiple
149 times.</para></listitem>
150 </varlistentry>
151
152 <varlistentry>
153 <term><option>--root=<replaceable>root</replaceable></option></term>
154 <listitem><para>Takes a directory path as an argument. All paths will be prefixed with the given alternate
155 <replaceable>root</replaceable> path, including config search paths.</para>
156
157 <para>Note that this option does not alter how the users and groups specified in the configuration files are
158 resolved. With or without this option, users and groups are always resolved according to the host's user and
159 group databases, any such databases stored under the specified root directories are not
160 consulted.</para></listitem>
161 </varlistentry>
162
163 <xi:include href="standard-options.xml" xpointer="help" />
164 <xi:include href="standard-options.xml" xpointer="version" />
165 </variablelist>
166
167 <para>It is possible to combine <option>--create</option>,
168 <option>--clean</option>, and <option>--remove</option> in one
169 invocation. For example, during boot the following command line is
170 executed to ensure that all temporary and volatile directories are
171 removed and created according to the configuration file:</para>
172
173 <programlisting>systemd-tmpfiles --remove --create</programlisting>
174
175 </refsect1>
176
177 <refsect1>
178 <title>Unprivileged --cleanup operation</title>
179
180 <para><command>systemd-tmpfiles</command> tries to avoid changing
181 the access and modification times on the directories it accesses,
182 which requires <constant>CAP_ADMIN</constant> privileges. When
183 running as non-root, directories which are checked for files to
184 clean up will have their access time bumped, which might prevent
185 their cleanup.
186 </para>
187 </refsect1>
188
189 <refsect1>
190 <title>Exit status</title>
191
192 <para>On success, 0 is returned, a non-zero failure code
193 otherwise.</para>
194 </refsect1>
195
196 <refsect1>
197 <title>See Also</title>
198 <para>
199 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
200 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
201 </para>
202 </refsect1>
203
204 </refentry>