3

I am using my Raspberry Pi with OpenMediaVault, a variant of Debian/Raspian intended for running a NAS server. The web interface for the operating system features a user interface that allows for hardware usage to be tracked using graphs generated by RRDTool that look like this:

RRDTool Graphs in OpenMediaVault

Obviously, the graphs are based on system time. I've noticed that this causes some problems when the Pi is rebooted or booted from a powered off state. When I first check the graphs after a reboot or fresh start, the graphs list a "Last Updated" date of December 2015, and when I force a refresh of the data, the graphs all end up looking like this:

RRDTool Graph Gone Wrong

I understand that this is happening because of the lack of an RTC on the Raspberry Pi, and although one could be acquired, I would like to work around doing so.

To do this, I would like to configure my Pi to sync both its date and time to an NTP server before RRDTool services kick in. Is it possible to achieve something like this?

2 Answers2

2

You could use the command ntpdate pool.ntp.org once the network is up (in a script in /etc/network/ip-up.d) and then once a day in root's crontab. If the time difference is too big after 24 hours, you can run it more frequently, like every 6 hours.

ott--
  • 189
  • 1
  • 1
  • 7
1

There is only one way to reach the Stratum-1 servers, and that is to use time.nist.gov which is a pool address all by itself.

It will reach the quickest and most accurate time available on the web.

It will run automatically.

Here is a Q&A on this Stack Exchange that explains how to do it:

How do I set Raspbian to use the primary time server time.nist.gov?

SDsolar
  • 2,378
  • 8
  • 26
  • 43