I'm using a Raspberry Pi 2 (Jessie) to log some data. It only runs for a few hours at a time. When I boot it, the clock is wrong. This has been discussed at length in a number of threads.
I'd like to wait until the clock is correct. Normally, before a synch, it displays the time it was shutdown, so I suspect it has fake-hwclock. The problem with this is that I can't simply wait until the clock is no longer 1st Jan 1970.
So I went with another suggested approach: to grep /var/log/syslog for "Time has been changed". The problem with this approach is that the syslog contains a record of EVERY instance where the time was changed.
Is there a log or something which contains only the system log for the present session (i.e. since last boot)? Does it contain a log that the time has been changed?
Are there any other suggestions as to how I might wait until the clock has been set after a boot? I won't be adding an RTC: the timestamp is just a nice-to-have. in fact, I can achieve everything else I need just with Python's time.monotonic().