chiark / gitweb /
man: document path units
[elogind.git] / man / systemd.timer.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
4         "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <!--
7   This file is part of systemd.
8
9   Copyright 2010 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU General Public License as published by
13   the Free Software Foundation; either version 2 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   General Public License for more details.
20
21   You should have received a copy of the GNU General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="systemd.timer">
26         <refentryinfo>
27                 <title>systemd.timer</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd.timer</refentrytitle>
42                 <manvolnum>5</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd.timer</refname>
47                 <refpurpose>systemd timer configuration files</refpurpose>
48         </refnamediv>
49
50         <refsynopsisdiv>
51                 <para><filename>systemd.timer</filename></para>
52         </refsynopsisdiv>
53
54         <refsect1>
55                 <title>Description</title>
56
57                 <para>A unit configuration file whose name ends in
58                 <filename>.timer</filename> encodes information about
59                 a timer controlled and supervised by systemd, for
60                 timer-based activation.</para>
61
62                 <para>This man page lists the configuration options
63                 specific to this unit type. See
64                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65                 for the common options of all unit configuration
66                 files. The common configuration items are configured
67                 in the generic [Unit] and [Install] sections. The
68                 timer specific configuration options are configured in
69                 the [Timer] section.</para>
70
71                 <para>For each timer file a matching unit file must
72                 exist, describing the unit to activate when the timer
73                 elapses. By default a service by the same name as the
74                 timer (except for the suffix) is activated. Example: a
75                 timer file <filename>foo.timer</filename> activates a
76                 matching service <filename>foo.service</filename>. The
77                 unit to activate may be controlled by
78                 <varname>Unit=</varname> (see below).</para>
79         </refsect1>
80
81         <refsect1>
82                 <title>Options</title>
83
84                 <para>Timer files must include a [Timer] section,
85                 which carries information about the timer it
86                 defines. The options specific to the [Timer] section
87                 of timer units are the following:</para>
88
89                 <variablelist>
90                         <varlistentry>
91                                 <term><varname>OnActive=</varname></term>
92                                 <term><varname>OnBootup=</varname></term>
93                                 <term><varname>OnStartup=</varname></term>
94                                 <term><varname>OnUnitActive=</varname></term>
95                                 <term><varname>OnUnitInactive=</varname></term>
96
97                                 <listitem><para>Defines timers
98                                 relative to different starting points:
99                                 <varname>OnActive=</varname> defines a
100                                 timer relative to the moment the timer
101                                 itself is
102                                 activated. <varname>OnBootup=</varname>
103                                 defines a timer relative to when the
104                                 machine was booted
105                                 up. <varname>OnStartup=</varname>
106                                 defines a timer relative to when
107                                 systemd was
108                                 started. <varname>OnUnitActive=</varname>
109                                 defines a timer relative to when the
110                                 unit the timer is activating was last
111                                 activated. <varname>OnUnitInactive=</varname>
112                                 defines a timer relative to when the
113                                 unit the timer is activating was last
114                                 deactivated.</para>
115
116                                 <para>Multiple directives may be
117                                 combined, of the same and of different
118                                 types. For example, by combining
119                                 <varname>OnBoot=</varname> and
120                                 <varname>OnUnitActive=</varname> it is
121                                 possible to define a timer that
122                                 elapses in regular intervals and
123                                 activates a specific service each
124                                 time.</para>
125
126                                 <para>The arguments to the directives
127                                 are time spans configured in
128                                 seconds. Example: "OnBoot=50" means
129                                 50s after boot-up. The argument may
130                                 also include time units. Example:
131                                 "OnBoot=5h 30min" means 5 hours and 30
132                                 minutes after boot-up. For details
133                                 about the syntax of time spans see
134                                 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
135
136                                 <para>If a timer configured with
137                                 <varname>OnBootup=</varname> or
138                                 <varname>OnStartup=</varname> is
139                                 already in the past when the timer
140                                 unit is activated, it will immediately
141                                 elapse and the configured unit is
142                                 started. This is not the case for
143                                 timers defined in the other
144                                 directives.</para></listitem>
145
146                                 <para>These are monotonic timers,
147                                 independant of wall-clock time and timezones. If the
148                                 computer is temporarily suspended, the
149                                 monotonic clock stops too.</para>
150
151                         </varlistentry>
152                         <varlistentry>
153                                 <term><varname>Unit=</varname></term>
154
155                                 <listitem><para>The unit to activate
156                                 when this timer elapses. The argument is a
157                                 unit name, whose suffix is not
158                                 <filename>.timer</filename>. If not
159                                 specified this value defaults to a
160                                 service that has the same name as the
161                                 timer unit, except for the
162                                 suffix. (See above.) It is recommended
163                                 that the unit name that is activated
164                                 and the unit name of the timer unit
165                                 is chosen identical except for the
166                                 suffix.</para></listitem>
167                         </varlistentry>
168                 </variablelist>
169         </refsect1>
170
171         <refsect1>
172                   <title>See Also</title>
173                   <para>
174                           <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
175                           <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
176                           <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
177                           <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
178                   </para>
179         </refsect1>
180
181 </refentry>