chiark / gitweb /
systemctl: make sure status -a doesn't terminate too soon
[elogind.git] / man / timedatectl.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 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         xmlns:xi="http://www.w3.org/2001/XInclude">
26
27         <refentryinfo>
28                 <title>timedatectl</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>timedatectl</refentrytitle>
43                 <manvolnum>1</manvolnum>
44         </refmeta>
45
46         <refnamediv>
47                 <refname>timedatectl</refname>
48                 <refpurpose>Control the system time and date</refpurpose>
49         </refnamediv>
50
51         <refsynopsisdiv>
52                 <cmdsynopsis>
53                         <command>timedatectl <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="req">COMMAND</arg></command>
54                 </cmdsynopsis>
55         </refsynopsisdiv>
56
57         <refsect1>
58                 <title>Description</title>
59
60                 <para><command>timedatectl</command> may be used to
61                 query and change the system clock and its
62                 settings.</para>
63         </refsect1>
64
65         <refsect1>
66                 <title>Options</title>
67
68                 <para>The following options are understood:</para>
69
70                 <variablelist>
71                         <varlistentry>
72                                 <term><option>--no-ask-password</option></term>
73
74                                 <listitem><para>Do not query the user
75                                 for authentication for privileged
76                                 operations.</para></listitem>
77                         </varlistentry>
78
79                         <varlistentry>
80                                 <term><option>--adjust-system-clock</option></term>
81
82                                 <listitem><para>If
83                                 <command>set-local-rtc</command> is
84                                 invoked and this option is passed, the
85                                 system clock is synchronized from the
86                                 RTC again, taking the new setting into
87                                 account. Otherwise, the RTC is
88                                 synchronized from the system
89                                 clock.</para></listitem>
90                         </varlistentry>
91
92                         <xi:include href="user-system-options.xml" xpointer="host" />
93                         <xi:include href="user-system-options.xml" xpointer="machine" />
94
95                         <xi:include href="standard-options.xml" xpointer="help" />
96                         <xi:include href="standard-options.xml" xpointer="version" />
97                         <xi:include href="standard-options.xml" xpointer="no-pager" />
98                 </variablelist>
99
100                 <para>The following commands are understood:</para>
101
102                 <variablelist>
103                         <varlistentry>
104                                 <term><command>status</command></term>
105
106                                 <listitem><para>Show current settings
107                                 of the system clock and
108                                 RTC.</para></listitem>
109                         </varlistentry>
110
111                         <varlistentry>
112                                 <term><command>set-time [TIME]</command></term>
113
114                                 <listitem><para>Set the system clock
115                                 to the specified time. This will also
116                                 update the RTC time accordingly. The time
117                                 may be specified in the format
118                                 "2012-10-30
119                                 18:17:16".</para></listitem>
120                         </varlistentry>
121
122                         <varlistentry>
123                                 <term><command>set-timezone [TIMEZONE]</command></term>
124
125                                 <listitem><para>Set the system time
126                                 zone to the specified value. Available
127                                 timezones can be listed with
128                                 <command>list-timezones</command>. If
129                                 the RTC is configured to be in the
130                                 local time, this will also update the
131                                 RTC time. This call will alter the
132                                 <filename>/etc/localtime</filename>
133                                 symlink. See
134                                 <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>
135                                 for more
136                                 information.</para></listitem>
137                         </varlistentry>
138
139                         <varlistentry>
140                                 <term><command>list-timezones</command></term>
141
142                                 <listitem><para>List available time
143                                 zones, one per line. Entries from the
144                                 list can be set as the system
145                                 timezone with
146                                 <command>set-timezone</command>.</para></listitem>
147                         </varlistentry>
148
149                         <varlistentry>
150                                 <term><command>set-local-rtc [BOOL]</command></term>
151
152                                 <listitem><para>Takes a boolean
153                                 argument. If <literal>0</literal>, the
154                                 system is configured to maintain the
155                                 RTC in universal time. If
156                                 <literal>1</literal>, it will maintain
157                                 the RTC in local time instead. Note
158                                 that maintaining the RTC in the local
159                                 timezone is not fully supported and
160                                 will create various problems with time
161                                 zone changes and daylight saving
162                                 adjustments. If at all possible, keep the
163                                 RTC in UTC mode. Note that invoking this
164                                 will also synchronize the RTC from the
165                                 system clock, unless
166                                 <option>--adjust-system-clock</option> is
167                                 passed (see above). This command will
168                                 change the 3rd line of
169                                 <filename>/etc/adjtime</filename>, as
170                                 documented in
171                                 <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
172                         </varlistentry>
173
174                         <varlistentry>
175                                 <term><command>set-ntp [BOOL]</command></term>
176
177                                 <listitem><para>Takes a boolean
178                                 argument. Controls whether NTP based
179                                 network time synchronization is
180                                 enabled (if
181                                 available).</para></listitem>
182                         </varlistentry>
183
184                 </variablelist>
185
186         </refsect1>
187
188         <refsect1>
189                 <title>Exit status</title>
190
191                 <para>On success, 0 is returned, a non-zero failure
192                 code otherwise.</para>
193         </refsect1>
194
195         <xi:include href="less-variables.xml" />
196
197         <refsect1>
198                 <title>Examples</title>
199                 <para>Show current settings:
200                 <programlisting>$ timedatectl
201       Local time: Fri, 2012-11-02 09:26:46 CET
202   Universal time: Fri, 2012-11-02 08:26:46 UTC
203         RTC time: Fri, 2012-11-02 08:26:45
204         Timezone: Europe/Warsaw
205       UTC offset: +0100
206      NTP enabled: no
207 NTP synchronized: no
208  RTC in local TZ: no
209       DST active: no
210  Last DST change: CEST → CET, DST became inactive
211                   Sun, 2012-10-28 02:59:59 CEST
212                   Sun, 2012-10-28 02:00:00 CET
213  Next DST change: CET → CEST, DST will become active
214                   the clock will jump one hour forward
215                   Sun, 2013-03-31 01:59:59 CET
216                   Sun, 2013-03-31 03:00:00 CEST</programlisting>
217                 </para>
218
219                 <para>Enable an NTP daemon (chronyd):
220                 <programlisting>$ timedatectl set-ntp true
221 ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
222 Authentication is required to control whether network time synchronization shall be enabled.
223 Authenticating as: user
224 Password: ********
225 ==== AUTHENTICATION COMPLETE ===</programlisting>
226
227                 <programlisting>$ systemctl status chronyd.service
228 chronyd.service - NTP client/server
229           Loaded: loaded (/usr/lib/systemd/system/chronyd.service; enabled)
230           Active: active (running) since Fri, 2012-11-02 09:36:25 CET; 5s ago
231 ...</programlisting>
232                 </para>
233         </refsect1>
234
235         <refsect1>
236                 <title>See Also</title>
237                 <para>
238                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
239                         <citerefentry><refentrytitle>hwclock</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
240                         <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
241                         <citerefentry><refentrytitle>localtime</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
242                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
243                         <citerefentry><refentrytitle>systemd-timedated.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
244                 </para>
245         </refsect1>
246
247 </refentry>