1

The who -b command desn't show me the last reboot times on my Raspberry 3

    :~ $ uname -a
Linux xxxxx 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
:~ $ who -b 
    system boot  1970-01-01 01:00

I configured the ntp daemon as the date is uptodate.

How to configure the system for getting this king of information.

Regards,

dubis
  • 131
  • 2
  • 6

1 Answers1

6

Short answer. Use: uptime -s

You can use the uptime command to find out how long it has been since the Pi (or any Unix/Linux OS) has booted. The -s flag tells uptime to calculate the boot time.

The Pi doesn't have a real-time clock (though there are RTC chips that you can add). This means it does not know the date/time as it boots. If it has access to a network, it'll reach out to a time server to set these. But if it doesn't have a network, it will rely on a fake hardware clock (basically a file where it periodically writes the time. It isn't accurate but at least it fixes problems where log files have "newer" entries with older date/time stamps than "older" entries.

See: How is time kept on the Raspberry Pi?

Tim Campbell
  • 885
  • 5
  • 16