Total runtime of machine
This isn’t something the firmware tracks, as far as I’m aware. Even BMCs don’t measure total uptime.
This won’t help with past uptime from previous boots, but you can start recording uptimes now, by installing a tool such as uptimed
and setting it up so that it never discards values (set LOG_MAXIMUM_ENTRIES
to 0 in uptimed.conf
). That will measure operating system uptime, not total CPU “on” time, but it should be close enough... Once you’ve got uptimed
running, you can run uprecords
to view the totals, for example
up 1492 days, 02:57:18 | since Sat Sep 7 00:50:06 2013
down 61 days, 08:11:24 | since Sat Sep 7 00:50:06 2013
%up 96.051 | since Sat Sep 7 00:50:06 2013
As pointed out by quixotic, you’ll be able to get some idea of historical uptime by looking at your logs. If you’re running systemd, you can view the boots which have been logged using journalctl --list-boots
. Log rotation means that this is likely to miss quite a lot of uptime though.
As pointed out by JdeBP, last reboot
might give you a longer list of boots with the associated uptime.