Managing time

How do people manage time on their systems on networks?

One problem I have is that I can't guarantee that my file server is connected to the Internet at boot time.

Is there any way to set the time when Internet access is attained, which in my case is when a USB tether connection to a phone is made?
 
One problem I have is that I can't guarantee that my file server is connected to the Internet at boot time.
That's why it has a hardware clock...

Usually you run a local ntp server on the gateway that has an internet connection available 24/7 and all local systems sync to that host.
 
That's why it has a hardware clock...

Usually you run a local ntp server on the gateway that has an internet connection available 24/7 and all local systems sync to that host.
I have a personal standard of: ntpdate -t 5 0.freebsd.pool.ntp.org &
to set the clock but I forgot what this really is. The url returns official time, based on ip geo-location? I like it for the case of a computer with a bad cmos battery. :p
 
If it's a major requirement to have correct NTP time at startup you should invest in a GPS time source, otherwise you are relying upon the hardware clock of your local server as a startup seed, then generally slowly skewing the local clock to match NTP time when network NTP server are available.
 
Did this on a Pi webserver no RTC for months :D (rc.conf):
Code:
ntpd_enable="YES"
ntpd_sync_on_start="YES"

Just re-read about no internet though; not sure about FreeBSD, but fake-hwclock covers that Linux: https://manpages.opensuse.org/Tumbleweed/fake-hwclock/fake-hwclock.8.en.html (sets time on a file that's read early-boot to set time, then that file's updated occasionally userspace to kind-of keep time up to 1hr accurate but good-enough for ntp-sync to fix eventually; works nice on RTC-less Pi too)
 
If it's a major requirement to have correct NTP time at startup you should invest in a GPS time source, otherwise you are relying upon the hardware clock of your local server as a startup seed, then generally slowly skewing the local clock to match NTP time when network NTP server are available.
Can you suggest a GPS time source? Obviously one which works with FreeBSD...
 
I use this. If you have an extra rpi and a few bucks for the antenna and PPS daughter board, it'll solve a lot of your issues. I run 2 of these and they maintain time to a high degree of accuracy, given the hardware involved. < 1 us, or so the devices tell me...


Not a FreeBSD solution, but I'm sure you could do the same running FBSD on your pi.
 
Since we're talking about a server, the system will be usually running and keeping time in sync via NTP. Time drift during reboots or short downtimes is usually negligible.
If the host completely looses time at reboot, replace the cmos battery.

(and if it doesn't have a RTC at all, its a toy and not a server)
 
You might want to look at chrony, it's supposed to be designed for intermittent connection.

One of the advantages of a full ntp daemon is that it keeps track of the system clock error rate and writes it out to a drift file; that allows the daemon to maintain better accuracy if the the network connection goes away.

By the sound of it this is just a home file server; running your own tier-0 server seems like overkill.
 
As long as you don't do any automated stock trading you really don't need microsecond accuracy. For most situations getting the time from a couple of internet time servers is "good enough".
 
Back
Top