"
I'd suggest to call hwclock -w on shutdown or periodically as a cron job.
"
root@rock64:~# cat /etc/cron.d/timesync2rtc1
# automatic timeset on /dev/rtc1 from system time in every 11 minutes on everyday ...
#PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
*/11 * * * * root /usr/bin/bash -c 'for i in 'ntp.ubuntu.com' '0.ubuntu.pool.ntp.org' '1.ubuntu.pool.ntp.org' '2.ubuntu.pool.ntp.org'; do /usr/bin/nc -v -z -u "$i" 123 && /usr/sbin/hwclock -w -f /dev/rtc1 && break; done'
root@rock64:~# egrep -iv "^#|^$" /etc/chrony/chrony.conf
pool ntp.ubuntu.com iburst maxsources 4
pool 0.ubuntu.pool.ntp.org iburst maxsources 1
pool 1.ubuntu.pool.ntp.org iburst maxsources 1
pool 2.ubuntu.pool.ntp.org iburst maxsources 2
keyfile /etc/chrony/chrony.keys
driftfile /var/lib/chrony/chrony.drift
logdir /var/log/chrony
maxupdateskew 100.0
makestep 1 3
server 192.178.0.213 iburst prefer
local stratum 8 orphan
allow 192.178.0.0/24
root@rock64:~# chronyc sources -v
210 Number of sources = 9
.-- Source mode '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current synced, '+' = combined , '-' = not combined,
| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
|| .- xxxx [ yyyy ] +/- zzzz
|| Reachability register (octal) -. | xxxx = adjusted offset,
|| Log2(Polling interval) --. | | yyyy = measured offset,
|| \ | | zzzz = estimated error.
|| | | \
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* rock64 3 8 377 49m -109us[ +23us] +/- 59ms
^- pugot.canonical.com 2 8 277 207 +2451us[+2451us] +/- 53ms
^- chilipepper.canonical.com 2 9 177 475 +199us[ +199us] +/- 57ms
^- alphyn.canonical.com 2 9 377 472 +513us[ +513us] +/- 116ms
^- golem.canonical.com 2 9 277 473 -3688us[-3688us] +/- 62ms
^- time.cloudflare.com 3 9 377 470 +537us[ +537us] +/- 25ms
^- prae.hu 3 9 377 470 -8304us[-8304us] +/- 57ms
^- time.cloudflare.com 3 9 377 412 -1216us[-1216us] +/- 24ms
^- login-vlan194.budapest2.> 2 9 377 466 +1594us[+1594us] +/- 44ms
root@rock64:~# timedatectl
Local time: Wed 2020-12-30 10:42:42 CET
Universal time: Wed 2020-12-30 09:42:42 UTC
RTC time: Wed 2020-12-30 09:42:48
Time zone: Europe/Budapest (CET, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
- Ice blogja
- A hozzászóláshoz be kell jelentkezni
- 254 megtekintés
Hozzászólások
Légy oly kedves ne mindent a bevezető dobozba rakj már bele, hanem a törzs dobozba.
- A hozzászóláshoz be kell jelentkezni