]> git.proxmox.com Git - systemd.git/blob - man/systemd.timer.5
Imported Upstream version 218
[systemd.git] / man / systemd.timer.5
1 '\" t
2 .TH "SYSTEMD\&.TIMER" "5" "" "systemd 218" "systemd.timer"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.timer \- Timer unit configuration
24 .SH "SYNOPSIS"
25 .PP
26 \fItimer\fR\&.timer
27 .SH "DESCRIPTION"
28 .PP
29 A unit configuration file whose name ends in
30 "\&.timer"
31 encodes information about a timer controlled and supervised by systemd, for timer\-based activation\&.
32 .PP
33 This man page lists the configuration options specific to this unit type\&. See
34 \fBsystemd.unit\fR(5)
35 for the common options of all unit configuration files\&. The common configuration items are configured in the generic [Unit] and [Install] sections\&. The timer specific configuration options are configured in the [Timer] section\&.
36 .PP
37 For each timer file, a matching unit file must exist, describing the unit to activate when the timer elapses\&. By default, a service by the same name as the timer (except for the suffix) is activated\&. Example: a timer file
38 foo\&.timer
39 activates a matching service
40 foo\&.service\&. The unit to activate may be controlled by
41 \fIUnit=\fR
42 (see below)\&.
43 .PP
44 Unless
45 \fIDefaultDependencies=\fR
46 is set to
47 \fBfalse\fR, all timer units will implicitly have dependencies of type
48 \fIConflicts=\fR
49 and
50 \fIBefore=\fR
51 on
52 shutdown\&.target
53 to ensure that they are stopped cleanly prior to system shutdown\&. Timer units with at least one
54 \fIOnCalendar=\fR
55 directive will have an additional
56 \fIAfter=\fR
57 dependency on
58 timer\-sync\&.target
59 to avoid being started before the system clock has been correctly set\&. Only timer units involved with early boot or late system shutdown should disable the
60 \fIDefaultDependencies=\fR
61 option\&.
62 .SH "OPTIONS"
63 .PP
64 Timer files must include a [Timer] section, which carries information about the timer it defines\&. The options specific to the [Timer] section of timer units are the following:
65 .PP
66 \fIOnActiveSec=\fR, \fIOnBootSec=\fR, \fIOnStartupSec=\fR, \fIOnUnitActiveSec=\fR, \fIOnUnitInactiveSec=\fR
67 .RS 4
68 Defines monotonic timers relative to different starting points:
69 \fIOnActiveSec=\fR
70 defines a timer relative to the moment the timer itself is activated\&.
71 \fIOnBootSec=\fR
72 defines a timer relative to when the machine was booted up\&.
73 \fIOnStartupSec=\fR
74 defines a timer relative to when systemd was first started\&.
75 \fIOnUnitActiveSec=\fR
76 defines a timer relative to when the unit the timer is activating was last activated\&.
77 \fIOnUnitInactiveSec=\fR
78 defines a timer relative to when the unit the timer is activating was last deactivated\&.
79 .sp
80 Multiple directives may be combined of the same and of different types\&. For example, by combining
81 \fIOnBootSec=\fR
82 and
83 \fIOnUnitActiveSec=\fR, it is possible to define a timer that elapses in regular intervals and activates a specific service each time\&.
84 .sp
85 The arguments to the directives are time spans configured in seconds\&. Example: "OnBootSec=50" means 50s after boot\-up\&. The argument may also include time units\&. Example: "OnBootSec=5h 30min" means 5 hours and 30 minutes after boot\-up\&. For details about the syntax of time spans, see
86 \fBsystemd.unit\fR(5)\&.
87 .sp
88 If a timer configured with
89 \fIOnBootSec=\fR
90 or
91 \fIOnStartupSec=\fR
92 is already in the past when the timer unit is activated, it will immediately elapse and the configured unit is started\&. This is not the case for timers defined in the other directives\&.
93 .sp
94 These are monotonic timers, independent of wall\-clock time and timezones\&. If the computer is temporarily suspended, the monotonic clock stops too\&.
95 .sp
96 If the empty string is assigned to any of these options, the list of timers is reset, and all prior assignments will have no effect\&.
97 .sp
98 Note that timers do not necessarily expire at the precise time configured with these settings, as they are subject to the
99 \fIAccuracySec=\fR
100 setting below\&.
101 .RE
102 .PP
103 \fIOnCalendar=\fR
104 .RS 4
105 Defines realtime (i\&.e\&. wallclock) timers with calendar event expressions\&. See
106 \fBsystemd.time\fR(7)
107 for more information on the syntax of calendar event expressions\&. Otherwise, the semantics are similar to
108 \fIOnActiveSec=\fR
109 and related settings\&.
110 .sp
111 Note that timers do not necessarily expire at the precise time configured with this setting, as it is subject to the
112 \fIAccuracySec=\fR
113 setting below\&.
114 .RE
115 .PP
116 \fIAccuracySec=\fR
117 .RS 4
118 Specify the accuracy the timer shall elapse with\&. Defaults to 1min\&. The timer is scheduled to elapse within a time window starting with the time specified in
119 \fIOnCalendar=\fR,
120 \fIOnActiveSec=\fR,
121 \fIOnBootSec=\fR,
122 \fIOnStartupSec=\fR,
123 \fIOnUnitActiveSec=\fR
124 or
125 \fIOnUnitInactiveSec=\fR
126 and ending the time configured with
127 \fIAccuracySec=\fR
128 later\&. Within this time window, the expiry time will be placed at a host\-specific, randomized but stable position that is synchronized between all local timer units\&. This is done in order to distribute the wake\-up time in networked installations, as well as optimizing power consumption to suppress unnecessary CPU wake\-ups\&. To get best accuracy, set this option to 1us\&. Note that the timer is still subject to the timer slack configured via
129 \fBsystemd-system.conf\fR(5)\*(Aqs
130 \fITimerSlackNSec=\fR
131 setting\&. See
132 \fBprctl\fR(2)
133 for details\&. To optimize power consumption, make sure to set this value as high as possible and as low as necessary\&.
134 .RE
135 .PP
136 \fIUnit=\fR
137 .RS 4
138 The unit to activate when this timer elapses\&. The argument is a unit name, whose suffix is not
139 "\&.timer"\&. If not specified, this value defaults to a service that has the same name as the timer unit, except for the suffix\&. (See above\&.) It is recommended that the unit name that is activated and the unit name of the timer unit are named identically, except for the suffix\&.
140 .RE
141 .PP
142 \fIPersistent=\fR
143 .RS 4
144 Takes a boolean argument\&. If true, the time when the service unit was last triggered is stored on disk\&. When the timer is activated, the service unit is triggered immediately if it would have been triggered at least once during the time when the timer was inactive\&. This is useful to catch up on missed runs of the service when the machine was off\&. Note that this setting only has an effect on timers configured with
145 \fIOnCalendar=\fR\&.
146 .RE
147 .PP
148 \fIWakeSystem=\fR
149 .RS 4
150 Takes a boolean argument\&. If true, an elapsing timer will cause the system to resume from suspend, should it be suspended and if the system supports this\&. Note that this option will only make sure the system resumes on the appropriate times, it will not take care of suspending it again after any work that is to be done is finished\&. Defaults to
151 \fIfalse\fR\&.
152 .RE
153 .SH "SEE ALSO"
154 .PP
155 \fBsystemd\fR(1),
156 \fBsystemctl\fR(1),
157 \fBsystemd.unit\fR(5),
158 \fBsystemd.service\fR(5),
159 \fBsystemd.time\fR(7),
160 \fBsystemd.directives\fR(7),
161 \fBsystemd-system.conf\fR(5),
162 \fBprctl\fR(2)