]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-tmpfiles.xml
Merge pull request #74 from systemd-mailing-devs/1432753344-31461-1-git-send-email...
[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 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 This file is part of systemd.
10
11 Copyright 2010 Lennart Poettering
12
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 -->
26
27 <refentry id="systemd-tmpfiles"
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>systemd-tmpfiles</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>Developer</contrib>
37 <firstname>Lennart</firstname>
38 <surname>Poettering</surname>
39 <email>lennart@poettering.net</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>systemd-tmpfiles</refentrytitle>
46 <manvolnum>8</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>systemd-tmpfiles</refname>
51 <refname>systemd-tmpfiles-setup.service</refname>
52 <refname>systemd-tmpfiles-setup-dev.service</refname>
53 <refname>systemd-tmpfiles-clean.service</refname>
54 <refname>systemd-tmpfiles-clean.timer</refname>
55 <refpurpose>Creates, deletes and cleans up volatile
56 and temporary files and directories</refpurpose>
57 </refnamediv>
58
59 <refsynopsisdiv>
60 <cmdsynopsis>
61 <command>systemd-tmpfiles</command>
62 <arg choice="opt" rep="repeat">OPTIONS</arg>
63 <arg choice="opt" rep="repeat"><replaceable>CONFIGFILE</replaceable></arg>
64 </cmdsynopsis>
65
66 <para><filename>systemd-tmpfiles-setup.service</filename></para>
67 <para><filename>systemd-tmpfiles-setup-dev.service</filename></para>
68 <para><filename>systemd-tmpfiles-clean.service</filename></para>
69 <para><filename>systemd-tmpfiles-clean.timer</filename></para>
70 </refsynopsisdiv>
71
72 <refsect1>
73 <title>Description</title>
74
75 <para><command>systemd-tmpfiles</command> creates, deletes, and
76 cleans up volatile and temporary files and directories, based on
77 the configuration file format and location specified in
78 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
79 </para>
80
81 <para>If invoked with no arguments, it applies all directives from
82 all configuration files. If one or more filenames are passed on
83 the command line, only the directives in these files are applied.
84 If only the basename of a configuration file is specified, all
85 configuration directories as specified in
86 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
87 are searched for a matching file.</para>
88 </refsect1>
89
90 <refsect1>
91 <title>Options</title>
92
93 <para>The following options are understood:</para>
94
95 <variablelist>
96 <varlistentry>
97 <term><option>--create</option></term>
98 <listitem><para>If this option is passed, all files and
99 directories marked with
100 <varname>f</varname>,
101 <varname>F</varname>,
102 <varname>w</varname>,
103 <varname>d</varname>,
104 <varname>D</varname>,
105 <varname>v</varname>,
106 <varname>p</varname>,
107 <varname>L</varname>,
108 <varname>c</varname>,
109 <varname>b</varname>,
110 <varname>m</varname>
111 in the configuration files are created or written to. Files
112 and directories marked with
113 <varname>z</varname>,
114 <varname>Z</varname>,
115 <varname>t</varname>,
116 <varname>T</varname>,
117 <varname>a</varname>, and
118 <varname>A</varname> have their ownership, access mode and
119 security labels set. </para></listitem>
120 </varlistentry>
121
122 <varlistentry>
123 <term><option>--clean</option></term>
124 <listitem><para>If this option is passed, all files and
125 directories with an age parameter configured will be cleaned
126 up.</para></listitem>
127 </varlistentry>
128
129 <varlistentry>
130 <term><option>--remove</option></term>
131 <listitem><para>If this option is passed, the contents of
132 directories marked with <varname>D</varname> or
133 <varname>R</varname>, and files or directories themselves
134 marked with <varname>r</varname> or <varname>R</varname> are
135 removed.</para></listitem>
136 </varlistentry>
137 <varlistentry>
138 <term><option>--boot</option></term>
139 <listitem><para>Also execute lines with an exclamation mark.
140 </para></listitem>
141 </varlistentry>
142 <varlistentry>
143 <term><option>--prefix=<replaceable>path</replaceable></option></term>
144 <listitem><para>Only apply rules with paths that start with
145 the specified prefix. This option can be specified multiple
146 times.</para></listitem>
147 </varlistentry>
148 <varlistentry>
149 <term><option>--exclude-prefix=<replaceable>path</replaceable></option></term>
150 <listitem><para>Ignore rules with paths that start with the
151 specified prefix. This option can be specified multiple
152 times.</para></listitem>
153 </varlistentry>
154 <varlistentry>
155 <term><option>--root=<replaceable>root</replaceable></option></term>
156 <listitem><para>Takes a directory path as an argument. All
157 paths will be prefixed with the given alternate
158 <replaceable>root</replaceable> path, including config search
159 paths. </para></listitem>
160 </varlistentry>
161
162 <xi:include href="standard-options.xml" xpointer="help" />
163 <xi:include href="standard-options.xml" xpointer="version" />
164 </variablelist>
165
166 <para>It is possible to combine <option>--create</option>,
167 <option>--clean</option>, and <option>--remove</option> in one
168 invocation. For example, during boot the following command line is
169 executed to ensure that all temporary and volatile directories are
170 removed and created according to the configuration file:</para>
171
172 <programlisting>systemd-tmpfiles --remove --create</programlisting>
173
174 </refsect1>
175
176 <refsect1>
177 <title>Unprivileged --cleanup operation</title>
178
179 <para><command>systemd-tmpfiles</command> tries to avoid changing
180 the access and modification times on the directories it accesses,
181 which requires <constant>CAP_ADMIN</constant> privileges. When
182 running as non-root, directories which are checked for files to
183 clean up will have their access time bumped, which might prevent
184 their cleanup.
185 </para>
186 </refsect1>
187
188 <refsect1>
189 <title>Exit status</title>
190
191 <para>On success, 0 is returned, a non-zero failure code
192 otherwise.</para>
193 </refsect1>
194
195 <refsect1>
196 <title>See Also</title>
197 <para>
198 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
199 <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>
200 </para>
201 </refsect1>
202
203 </refentry>