2

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
  • 141
  • 1
  • 2
  • 7

1 Answers1

8

Short answer: Use: uptime --since (-s for short)

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 also.

Pablo A
  • 109
  • 4
Tim Campbell
  • 1,060
  • 8
  • 17