]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-tmpfiles.xml
tmpfiles: do not bump access times of directories we are cleaning up
[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,
73 deletes, and cleans up volatile and temporary files and
74 directories, based on the configuration file format and
75 location specified in
76 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
77 </para>
78
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>
87 </refsect1>
88
89 <refsect1>
90 <title>Options</title>
91
92 <para>The following options are understood:</para>
93
94 <variablelist>
95 <varlistentry>
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>v</varname>,
105 <varname>p</varname>,
106 <varname>L</varname>,
107 <varname>c</varname>,
108 <varname>b</varname>,
109 <varname>m</varname> in the
110 configuration files are created or
111 written to. Files and directories
112 marked with <varname>z</varname>,
113 <varname>Z</varname>,
114 <varname>t</varname>,
115 <varname>T</varname>,
116 <varname>a</varname>, and
117 <varname>A</varname> have their
118 ownership, access mode and security
119 labels set. </para></listitem>
120 </varlistentry>
121
122 <varlistentry>
123 <term><option>--clean</option></term>
124 <listitem><para>If this option is
125 passed, all files and directories with
126 an age parameter configured will be
127 cleaned up.</para></listitem>
128 </varlistentry>
129
130 <varlistentry>
131 <term><option>--remove</option></term>
132 <listitem><para>If this option is
133 passed, the contents of
134 directories marked with
135 <varname>D</varname> or
136 <varname>R</varname>, and files or
137 directories themselves marked with
138 <varname>r</varname> or
139 <varname>R</varname> are
140 removed.</para></listitem>
141 </varlistentry>
142 <varlistentry>
143 <term><option>--boot</option></term>
144 <listitem><para>Also execute lines
145 with an exclamation mark.
146 </para></listitem>
147 </varlistentry>
148 <varlistentry>
149 <term><option>--prefix=<replaceable>path</replaceable></option></term>
150 <listitem><para>Only apply rules that
151 apply to paths with the specified
152 prefix. This option can be specified
153 multiple times.</para></listitem>
154 </varlistentry>
155 <varlistentry>
156 <term><option>--exclude-prefix=<replaceable>path</replaceable></option></term>
157 <listitem><para>Ignore rules that
158 apply to paths with the specified
159 prefix. This option can be specified
160 multiple times.</para></listitem>
161 </varlistentry>
162 <varlistentry>
163 <term><option>--root=<replaceable>root</replaceable></option></term>
164 <listitem><para>Takes a directory path
165 as an argument. All paths will be
166 prefixed with the given alternate <replaceable>root</replaceable>
167 path, including config search paths.
168 </para></listitem>
169 </varlistentry>
170
171 <xi:include href="standard-options.xml" xpointer="help" />
172 <xi:include href="standard-options.xml" xpointer="version" />
173 </variablelist>
174
175 <para>It is possible to combine
176 <option>--create</option>, <option>--clean</option>,
177 and <option>--remove</option> in one invocation. For
178 example, during boot the following command line is
179 executed to ensure that all temporary and volatile
180 directories are removed and created according to the
181 configuration file:</para>
182
183 <programlisting>systemd-tmpfiles --remove --create</programlisting>
184
185 </refsect1>
186
187 <refsect1>
188 <title>Unprivileged --cleanup operation</title>
189
190 <para><command>systemd-tmpfiles</command> tries to
191 avoid changing the access and modification times on
192 the directories it accesses, which requires
193 <constant>CAP_ADMIN</constant> privileges. When
194 running as non-root, directories which are checked for
195 files to clean up will have their access time bumped,
196 which might prevent their cleanup.
197 </para>
198 </refsect1>
199
200 <refsect1>
201 <title>Exit status</title>
202
203 <para>On success, 0 is returned, a non-zero failure
204 code otherwise.</para>
205 </refsect1>
206
207 <refsect1>
208 <title>See Also</title>
209 <para>
210 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
211 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
212 </para>
213 </refsect1>
214
215 </refentry>