Skip to content

NTP SYNC VIA SYSTEMD

You can have systemd keep your time sync'ed up automatically.

On EL/Fedora its quite simple. Other distributions are likely simple as well, but the package names are going to be different.

1. INSTALL NEEDED PACKAGES

sudo dnf in -y systemd-timesyncd

2. ENABLE SYNC

sudo timedatectl set-ntp true

3. VERIFY ALL THINGS ARE WORKING

$ timedatectl
               Local time: Sat 2024-05-11 07:07:15 CDT
           Universal time: Sat 2024-05-11 12:07:15 UTC
                 RTC time: Sat 2024-05-11 12:07:15
                Time zone: US/Central (CDT, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

You may have an issue with your RTC clock :

timedatectl
               Local time: Sat 2024-05-11 07:03:15 CDT
           Universal time: Sat 2024-05-11 12:03:15 UTC
                 RTC time: Sat 2024-05-11 07:03:15
                Time zone: America/Chicago (CDT, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.

The fix is as simple as the warning message states:

sudo timedatectl set-local-rtc 0