How to enable or disable NTP time synchronization on the Raspberry Pi
Disable NTP:
disable_ntp.sh
sudo systemctl disable --now systemd-timesyncdEnable NTP:
enable_ntp.sh
sudo systemctl enable --now systemd-timesyncdVerifying if NTP is active
You can verify if NTP is active or not by running
timedatectl.txt
timedatectlThen look for these lines:
ntp_active.txt
System clock synchronized: yes
NTP service: activeSystem clock synchronized will tell you if the NTP service has successfully synchronized the system time to a NTP time server: yes if synchronized, no if not synchronized.
NTP service will tell you if the NTP service is running, i.e. if it is trying to synchronize the system time to a NTP time server: active if running, inactive when not running
Output with NTP active:
example.txt
Local time: Tue 2023-03-14 16:49:28 CET
Universal time: Tue 2023-03-14 15:49:28 UTC
RTC time: Tue 2023-03-14 15:49:28
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: noOutput with NTP inactive:
ntp_inactive.txt
Local time: Tue 2023-03-14 16:48:01 CET
Universal time: Tue 2023-03-14 15:48:01 UTC
RTC time: Tue 2023-03-14 15:48:01
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: noCheck out similar posts by category:
Linux, Raspberry Pi
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow