Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

chronyc

Talk to the chrony NTP daemon: show time sources, sync state and statistics, or make the clock step.

Niveau
RHCSA-examen
Groep
Tijd
Root nodig
Voor wijzigingen
Pakket
chrony

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

chronyd syncs the clock with the servers in /etc/chrony.conf. chronyc sources lists them (the one with ^* is used); chronyc tracking shows how far the clock is from the reference. Some commands (like makestep) need root.

Zo schrijf je het

chronyc [OPTION]... [COMMAND]...

Belangrijkste delen

sources [-v]
Time sources and their state (-v = with a legend).
sourcestats [-v]
Drift and offset statistics per source.
tracking
Sync state of the system clock.
makestep
Correct the clock at once (step).
activity
Number of online/offline sources.
clients
NTP clients of this server.
ntpdata [ADDR]
Details of the last NTP packets.
online / offline
Mark sources online or offline.
burst N/M
Send quick measurements.
add server NAME / delete ADDR
Change sources at run time.
reload sources
Reload sources from sourcedir files.
serverstats
Statistics of the NTP server part.
waitsync [N [MAX [MAXSKEW [INTERVAL]]]]
Wait until synchronized (scripts).
rtcdata
RTC information.

Opties 13

Meest gebruikt

-n
Do not resolve addresses to names.
-c
CSV output.
-4, -6
Use IPv4 or IPv6 only.
-N
Show the original source names.
-a
Authenticate (old option).
-e
End each answer with a dot line.
-d
Debug.
-m
Allow several commands on the command line.
-h HOST
Connect to chronyd on another host.
-p PORT
Use another port.
-f FILE
Config file (ignored, for compatibility).
-v, --version
Show the version.
--help
Show help.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 1Which sources?

    chronyc sources
    MS Name/IP address         Stratum Poll Reach LastRx Last sample
    ===============================================================================
    ^* server1                       3   6   377    34   +112us[ +140us] +/-   18ms

    ^* = selected source; Reach 377 = the last 8 polls worked.

  2. 2With a legend

    chronyc sources -v

    Explains every column.

  3. 3Is the clock synced?

    chronyc tracking
    Reference ID    : C0A87A0A (server1)
    Stratum         : 4
    System time     : 0.000012 seconds fast of NTP time
    Leap status     : Normal

    Leap status Normal = synchronized.

  4. 4Correct a big offset now

    chronyc makestep
    200 OK

    Normally chrony slews slowly; makestep jumps.

  5. 5Wait in a script until synced

    chronyc waitsync 30 0.1

    Up to 30 tries until the offset is under 0.1 s.

  6. 6NTP clients of a time server

    chronyc clients

    Which hosts sync from this server.

  7. 7Statistics

    chronyc sourcestats -v

    Frequency and offset of each source.

  8. 8Add a server at run time

    chronyc add server 192.168.122.1 iburst

    Not saved; put it in chrony.conf too.

  9. 9Activity

    chronyc activity
    200 OK
    1 sources online

    Count of reachable sources.

  10. 10Check a remote chronyd

    chronyc -h server1 tracking

    Needs cmdallow on the remote side.

Bestanden

/etc/chrony.conf
Servers, pools, allow lines.
/var/lib/chrony/drift
Clock drift data.

Exitcodes

0 :: Done. 1 :: Error.