I'm setting up Ubuntu on an embedded machine that runs over a cellular connection, where we pay per byte. The machine also has no RTC battery, so it starts from a random time every boot.
I'd like to ensure that the time gets synced up when the cellular connection comes available so that log messages, etc have real times, but I also don't want to pay an arm and a leg for NTP traffic.
Can I customize the rate at which NTP updates the time? I'm using openntpd currently, but I'm not wedded to it.
The internet is not necessarily up at boot, so ntupdate and related at startup won't work. And scheduling via cron means waiting for the scheduled task to kick in, whereas I want a time daemon to get a time sync ASAP.
Best Answer
Some of these answers could win the obfuscated ntp configuration contest.
Use the ntp reference implementation and use iburst to set the time quickly upon booting. After that the you can use the minpoll directive to limit how often ntpd queries remote time servers. This will allow you to take advantage of ntpd's clock disciplining and keep the bandwidth down.
Chrony is a good alternative to the ntp reference implementation. Openntpd is not.