What is the optimum/ideal Pi configuration setup to trigger a refresh of system clock from the RTC on reboot?
The RTC post raised in the Pi 4 discussion provided motivation to ask the question.
I just discovered a time sync loss between the RTC and the system clock after the Pi was left powered off for three weeks. On boot up the system clock had a time based on or around the time the unit was powered down. The RTC closely reflected the current time.
What is the link between system clock and RTC on bootup? I placed the following command hwclock --hctosys in /etc/rc.local to seed the system clock with the hwclock time on boot. This seems like a kludge. I assumed an RTC installation would provide a mechanism to ensure this happens. I haven't found anything that closely resembles that I am looking for.
This adafruit setup https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time doesn't provide any reboot configuration details for Jessie but Wheezy it does make reference to /etc/rc.local
The RTC is working satisfactorily. The system clock is working satisfactorily. I only notice the issue of time sync loss after the Pi was powered down for an extended time.
What are your solutions to sync'ing the clocks?
BoM
- Pi3B+
- Raspbian 2019-04-08
- RTC DS3231
Sean