Chrony Time sync between computers - githeim/windheim_archive GitHub Wiki

Chrony is the substitute of NTP.

install

$ sudo apt install chrony

configuration file

/etc/chrony/chrony.conf

reference link https://chrony.tuxfamily.org/doc/3.4/chrony.conf.html

setup local time server (in case of south korea)


...

# About using servers from the NTP Pool Project in general see (LP: #104525).
# Approved by Ubuntu Technical Board on 2011-02-08.
# See http://www.pool.ntp.org/join.html for more information.
# :x: pool ntp.ubuntu.com        iburst maxsources 4
# :x: pool 0.ubuntu.pool.ntp.org iburst maxsources 1
# :x: pool 1.ubuntu.pool.ntp.org iburst maxsources 1
# :x: pool 2.ubuntu.pool.ntp.org iburst maxsources 2
# local area timeserver customize
server 0.kr.pool.ntp.org iburst
server 3.asia.pool.ntp.org iburst
server 1.asia.pool.ntp.org iburst
# the server that the system should synchronize
server 192.168.10.10 iburst prefer minpoll -2 maxpoll 4 maxdelay .01   

# :x: allowed IPs
allow 192.168.10

...

After editing config file, then

$ sudo systemctl restart chronyd.service

synchronization tracking

$ chronyc tracking

or

$ watch -n 1 chronyc tracking     # <-- report every 1.0 sec

check sources status

$ chronyc sources

Get system time in msec scale

date +"%T.%3N"