I'm using an RPi with Raspbian which runs the NTP-daemon by default. I have connected an rtc-ds1307 external i2c hardware clock. I was following the instructions given here to set it up:
After removing the default fake-hwclock from the system, basically everything worked fine. When I boot the RPi without network connection, the time from the external hwclock is copied to the system clock. When there is Internet connection the NTP-daemon updates the system time afterwards. When I regularly shut down the RPi, the Internet-time is copied to the external hwclock. But in case of a power out, the old time remains on it.
Is there a simple way to always check the difference between the hw-clock and the time-server. I mean, if the time-server can be accessed and there is a certain difference between hw-clock and the time-server, then the hw-clock should be updated. If there is no Internet connection, the system anyway relies on the hw-clock after booting.