chiark / gitweb /
analyze: change behaviour of combined --to/from--pattern
[elogind.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
79     all configuration files. If one or more filenames are passed on
80     the command line, only the directives in these files are applied.
81     If only the basename of a configuration file is specified, all
82     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       <varlistentry>
152         <term><option>--root=<replaceable>root</replaceable></option></term>
153         <listitem><para>Takes a directory path as an argument. All
154         paths will be prefixed with the given alternate
155         <replaceable>root</replaceable> path, including config search
156         paths. </para></listitem>
157       </varlistentry>
158
159       <xi:include href="standard-options.xml" xpointer="help" />
160       <xi:include href="standard-options.xml" xpointer="version" />
161     </variablelist>
162
163     <para>It is possible to combine <option>--create</option>,
164     <option>--clean</option>, and <option>--remove</option> in one
165     invocation. For example, during boot the following command line is
166     executed to ensure that all temporary and volatile directories are
167     removed and created according to the configuration file:</para>
168
169     <programlisting>systemd-tmpfiles --remove --create</programlisting>
170
171   </refsect1>
172
173   <refsect1>
174     <title>Unprivileged --cleanup operation</title>
175
176     <para><command>systemd-tmpfiles</command> tries to avoid changing
177     the access and modification times on the directories it accesses,
178     which requires <constant>CAP_ADMIN</constant> privileges. When
179     running as non-root, directories which are checked for files to
180     clean up will have their access time bumped, which might prevent
181     their cleanup.
182     </para>
183   </refsect1>
184
185   <refsect1>
186     <title>Exit status</title>
187
188     <para>On success, 0 is returned, a non-zero failure code
189     otherwise.</para>
190   </refsect1>
191
192   <refsect1>
193     <title>See Also</title>
194     <para>
195       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
196       <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
197     </para>
198   </refsect1>
199
200 </refentry>