]>
Commit | Line | Data |
---|---|---|
663996b3 MS |
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 2012 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="timedatectl" conditional='ENABLE_TIMEDATED'> | |
25 | ||
26 | <refentryinfo> | |
27 | <title>timedatectl</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>timedatectl</refentrytitle> | |
42 | <manvolnum>1</manvolnum> | |
43 | </refmeta> | |
44 | ||
45 | <refnamediv> | |
46 | <refname>timedatectl</refname> | |
47 | <refpurpose>Control the system time and date</refpurpose> | |
48 | </refnamediv> | |
49 | ||
50 | <refsynopsisdiv> | |
51 | <cmdsynopsis> | |
52 | <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command> | |
53 | </cmdsynopsis> | |
54 | </refsynopsisdiv> | |
55 | ||
56 | <refsect1> | |
57 | <title>Description</title> | |
58 | ||
59 | <para><command>timedatectl</command> may be used to | |
60 | query and change the system clock and its | |
61 | settings.</para> | |
62 | </refsect1> | |
63 | ||
64 | <refsect1> | |
65 | <title>Options</title> | |
66 | ||
67 | <para>The following options are understood:</para> | |
68 | ||
69 | <variablelist> | |
70 | <varlistentry> | |
71 | <term><option>-h</option></term> | |
72 | <term><option>--help</option></term> | |
73 | ||
74 | <listitem><para>Prints a short help | |
75 | text and exits.</para></listitem> | |
76 | </varlistentry> | |
77 | ||
78 | <varlistentry> | |
79 | <term><option>--version</option></term> | |
80 | ||
81 | <listitem><para>Prints a short version | |
82 | string and exits.</para></listitem> | |
83 | </varlistentry> | |
84 | ||
85 | <varlistentry> | |
86 | <term><option>--no-pager</option></term> | |
87 | ||
88 | <listitem><para>Do not pipe output into a | |
89 | pager.</para></listitem> | |
90 | </varlistentry> | |
91 | ||
92 | <varlistentry> | |
93 | <term><option>--no-ask-password</option></term> | |
94 | ||
14228c0d | 95 | <listitem><para>Do not query the user |
663996b3 MS |
96 | for authentication for privileged |
97 | operations.</para></listitem> | |
98 | </varlistentry> | |
99 | ||
14228c0d MB |
100 | <varlistentry> |
101 | <term><option>-P</option></term> | |
102 | <term><option>--privileged</option></term> | |
103 | ||
104 | <listitem><para>Acquire privileges via PolicyKit | |
105 | before executing the operation.</para></listitem> | |
106 | </varlistentry> | |
107 | ||
663996b3 MS |
108 | <varlistentry> |
109 | <term><option>-H</option></term> | |
110 | <term><option>--host</option></term> | |
111 | ||
112 | <listitem><para>Execute the operation | |
113 | remotely. Specify a hostname, or | |
14228c0d | 114 | username and hostname separated by <literal>@</literal>, |
663996b3 MS |
115 | to connect to. This will use SSH to |
116 | talk to a remote | |
117 | system.</para></listitem> | |
118 | </varlistentry> | |
119 | ||
120 | <varlistentry> | |
121 | <term><option>--adjust-system-clock</option></term> | |
122 | ||
123 | <listitem><para>If | |
124 | <command>set-local-rtc</command> is | |
14228c0d | 125 | invoked and this option is passed, the |
663996b3 MS |
126 | system clock is synchronized from the |
127 | RTC again, taking the new setting into | |
14228c0d | 128 | account. Otherwise, the RTC is |
663996b3 MS |
129 | synchronized from the system |
130 | clock.</para></listitem> | |
131 | </varlistentry> | |
132 | </variablelist> | |
133 | ||
134 | <para>The following commands are understood:</para> | |
135 | ||
136 | <variablelist> | |
137 | <varlistentry> | |
138 | <term><command>status</command></term> | |
139 | ||
140 | <listitem><para>Show current settings | |
141 | of the system clock and | |
142 | RTC.</para></listitem> | |
143 | </varlistentry> | |
144 | ||
145 | <varlistentry> | |
146 | <term><command>set-time [TIME]</command></term> | |
147 | ||
148 | <listitem><para>Set the system clock | |
149 | to the specified time. This will also | |
150 | update the RTC time accordingly. The time | |
151 | may be specified in the format | |
152 | "2012-10-30 | |
153 | 18:17:16".</para></listitem> | |
154 | </varlistentry> | |
155 | ||
156 | <varlistentry> | |
157 | <term><command>set-timezone [TIMEZONE]</command></term> | |
158 | ||
159 | <listitem><para>Set the system time | |
160 | zone to the specified value. Available | |
14228c0d | 161 | timezones can be listed with |
663996b3 MS |
162 | <command>list-timezones</command>. If |
163 | the RTC is configured to be in the | |
14228c0d | 164 | local time, this will also update the |
663996b3 MS |
165 | RTC time. This call will alter the |
166 | <filename>/etc/localtime</filename> | |
167 | symlink. See | |
168 | <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
169 | for more | |
170 | information.</para></listitem> | |
171 | </varlistentry> | |
172 | ||
173 | <varlistentry> | |
174 | <term><command>list-timezones</command></term> | |
175 | ||
176 | <listitem><para>List available time | |
177 | zones, one per line. Entries from the | |
178 | list can be set as the system | |
14228c0d | 179 | timezone with |
663996b3 MS |
180 | <command>set-timezone</command>.</para></listitem> |
181 | </varlistentry> | |
182 | ||
183 | <varlistentry> | |
184 | <term><command>set-local-rtc [BOOL]</command></term> | |
185 | ||
186 | <listitem><para>Takes a boolean | |
14228c0d | 187 | argument. If <literal>0</literal>, the |
663996b3 | 188 | system is configured to maintain the |
14228c0d MB |
189 | RTC in universal time. If |
190 | <literal>1</literal>, it will maintain | |
663996b3 MS |
191 | the RTC in local time instead. Note |
192 | that maintaining the RTC in the local | |
14228c0d | 193 | timezone is not fully supported and |
663996b3 MS |
194 | will create various problems with time |
195 | zone changes and daylight saving | |
14228c0d MB |
196 | adjustments. If at all possible, keep the |
197 | RTC in UTC mode. Note that invoking this | |
663996b3 MS |
198 | will also synchronize the RTC from the |
199 | system clock, unless | |
200 | <option>--adjust-system-clock</option> is | |
201 | passed (see above). This command will | |
202 | change the 3rd line of | |
203 | <filename>/etc/adjtime</filename>, as | |
204 | documented in | |
205 | <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem> | |
206 | </varlistentry> | |
207 | ||
208 | <varlistentry> | |
209 | <term><command>set-ntp [BOOL]</command></term> | |
210 | ||
211 | <listitem><para>Takes a boolean | |
212 | argument. Controls whether NTP based | |
213 | network time synchronization is | |
214 | enabled (if | |
215 | available).</para></listitem> | |
216 | </varlistentry> | |
217 | ||
218 | </variablelist> | |
219 | ||
220 | </refsect1> | |
221 | ||
222 | <refsect1> | |
223 | <title>Exit status</title> | |
224 | ||
225 | <para>On success 0 is returned, a non-zero failure | |
226 | code otherwise.</para> | |
227 | </refsect1> | |
228 | ||
229 | <refsect1> | |
230 | <title>Environment</title> | |
231 | ||
232 | <variablelist class='environment-variables'> | |
233 | <varlistentry> | |
234 | <term><varname>$SYSTEMD_PAGER</varname></term> | |
235 | <listitem><para>Pager to use when | |
236 | <option>--no-pager</option> is not given; | |
237 | overrides <varname>$PAGER</varname>. Setting | |
238 | this to an empty string or the value | |
239 | <literal>cat</literal> is equivalent to passing | |
240 | <option>--no-pager</option>.</para></listitem> | |
241 | </varlistentry> | |
242 | </variablelist> | |
243 | </refsect1> | |
244 | ||
245 | <refsect1> | |
246 | <title>Examples</title> | |
247 | <para>Show current settings: | |
248 | <programlisting> | |
249 | $ timedatectl | |
250 | Local time: Fri, 2012-11-02 09:26:46 CET | |
251 | Universal time: Fri, 2012-11-02 08:26:46 UTC | |
252 | RTC time: Fri, 2012-11-02 08:26:45 | |
253 | Timezone: Europe/Warsaw | |
254 | UTC offset: +0100 | |
255 | NTP enabled: no | |
256 | NTP synchronized: no | |
257 | RTC in local TZ: no | |
258 | DST active: no | |
259 | Last DST change: CEST → CET, DST became inactive | |
260 | Sun, 2012-10-28 02:59:59 CEST | |
261 | Sun, 2012-10-28 02:00:00 CET | |
262 | Next DST change: CET → CEST, DST will become active | |
263 | the clock will jump one hour forward | |
264 | Sun, 2013-03-31 01:59:59 CET | |
265 | Sun, 2013-03-31 03:00:00 CEST | |
266 | </programlisting> | |
267 | </para> | |
268 | ||
269 | <para>Enable an NTP daemon (chronyd): | |
270 | <programlisting> | |
271 | $ timedatectl set-ntp true | |
272 | ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp === | |
273 | Authentication is required to control whether network time synchronization shall be enabled. | |
274 | Authenticating as: user | |
275 | Password: ******** | |
276 | ==== AUTHENTICATION COMPLETE === | |
277 | </programlisting> | |
278 | ||
279 | <programlisting> | |
280 | $ systemctl status chronyd.service | |
281 | chronyd.service - NTP client/server | |
282 | Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled) | |
283 | Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago | |
284 | ... | |
285 | </programlisting> | |
286 | </para> | |
287 | </refsect1> | |
288 | ||
289 | <refsect1> | |
290 | <title>See Also</title> | |
291 | <para> | |
292 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
293 | <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
294 | <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
295 | <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
296 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
297 | <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
298 | </para> | |
299 | </refsect1> | |
300 | ||
301 | </refentry> |