“What were the last two boot times?”
If you ask these questions regarding system uptime, then uprecords will provide the answers.
Uprecords is a command-line program that provides the times and dates for past system boots. It obtains its information from the uptimed daemon that records system uptimes.
Information provided by uprecords is presented in a user-friendly manner and shows the essentials without bogging the user down in details.
Uprecords is available for free from the repository and can be installed using the Synaptic Package Manager or the command line. To install uprecords, install the uptimed package.
sudo apt-get install uptimed
No reboot is necessary. Once installed, uprecords can be viewed by entering uprecords at the command line.
Uprecords will display a short table of system times and then exit back to the command prompt. Each entry from the top denotes separate system boots:
- Time and date the system booted up
- Length of the system uptime for that session
- Kernel used during that time
Here, we see three different uptimes. After installing uptimed, the system was rebooted three separate times to show that uptime information persists across system reboots.
The line denoted by the arrow (->) is the current system session. Sessions are organized by length. Entry #1 represents the longest duration, and the last entry is the shortest. More entries are added as the system accumulates more system boots.
As session duration increases, its entry will move to the top.
The same session has been running for 11 minutes, so it is now shown in second place out of three different boots.
The bottom portion displays statistic totals for easier reading.
- NewRec When uprecords was last called since the given time and date.
- up Total system uptime by adding all uptimes from the Uptime column.
- down Total time the system has been turned off.
- %up Percentage expression of the total uptime compared to the total downtime.
Uprecords offers a few options to customize the view, and full details can be found in the man page.
Most options are self-explanatory. For example, the -f option runs uprecords in a loop and updates its information every five seconds by default. This is useful for real-time monitoring. (Press Ctrl+C to exit back to the command prompt.)
The update interval can be changed using the -i option followed by a number in seconds. To update uprecords every second in real-time,
uprecords -i 1
Play with options! Uprecords is a useful alternative for obtaining the system uptime in a neatly presented manner, so it is sure to find a place in your system administration toolbox.