LinuxCommandLibrary

uprecords

Show system uptime records

TLDR

Display a summary of the top 10 historical uptime records

$ uprecords
copy

Display the top 25 records
$ uprecords -m [25]
copy

Display the downtime between reboots instead of the kernel version
$ uprecords -d
copy

Show the most recent reboots
$ uprecords -B
copy

Don't truncate information
$ uprecords -w
copy

SYNOPSIS

uprecords [ options ] [ wtmpfile ]

PARAMETERS

-a
    Displays all login and logout records in addition to system boot and reboot events, providing a more verbose output of the wtmp file contents.

-b
    Shows the exact boot time for each entry, adding precision to the reported uptime periods.

-s
    Prints system statistics, which may include summaries such as the total number of reboots or the average uptime, depending on the specific implementation.

wtmpfile
    Specifies an alternative wtmp file to read from, instead of the default /var/log/wtmp. This is useful for analyzing archived or custom log files.

DESCRIPTION

uprecords is a utility designed to provide a historical overview of a Linux system's uptime and reboot events. It primarily achieves this by parsing the wtmp file, typically located at /var/log/wtmp, which records all system logins, logouts, boots, and shutdown events. By analyzing this log, uprecords can present a chronological list of when the system started, how long it remained operational, and the sequence of reboots. This tool is invaluable for system administrators and users alike to track system availability, identify patterns in reboots (e.g., planned maintenance, unexpected crashes, or power failures), and verify adherence to uptime-related service level agreements (SLAs). It offers a concise way to understand a system's operational history without the need to manually interpret raw log files.

CAVEATS

The availability of the uprecords command can vary significantly across different Linux distributions and versions of the sysstat package. In many modern distributions, its functionality might be superseded by or integrated into other commands like last(1) (specifically last reboot) or custom scripting. It relies heavily on the integrity and proper maintenance of the wtmp file; if this file is corrupted, rotated without archiving, or not properly logged, the historical data provided by uprecords will be inaccurate or incomplete. It generally offers limited advanced filtering or reporting capabilities compared to more comprehensive log analysis tools.

DATA SOURCE: THE <I>WTMP</I> FILE

uprecords operates by parsing the binary wtmp file (e.g., /var/log/wtmp). This critical system file logs all user logins and logouts, system boots, and shutdown events. Understanding that uprecords relies on this specific file is crucial for interpreting its output and recognizing its limitations. Any issues with wtmp, such as corruption, improper rotation, or disabled logging, will directly impact the accuracy and completeness of the historical data presented by uprecords.

OUTPUT INTERPRETATION

The typical output of uprecords presents a chronological sequence of system boot events. For each event, it usually indicates the boot time and the duration of the uptime period preceding the next shutdown or reboot. Users should note that 'uptime' in this context refers to the continuous operational period of the system between one boot event and its subsequent shutdown or reboot. The command aims to provide a clear, concise summary of these operational cycles.

HISTORY

The uprecords command has historically been part of the sysstat package on various Linux distributions, particularly in older system versions from the early to mid-2000s. Its precise inclusion and specific implementation have shown variability over time. In contemporary Linux environments, its dedicated functionality often overlaps with or has been absorbed by more robust features in commands like last(1), which can effectively display reboot history. While it served as a straightforward utility for quickly parsing wtmp to ascertain system uptime history, its standalone presence has diminished as more comprehensive log analysis tools and integrated command features have evolved.

SEE ALSO

last(1), uptime(1), w(1), sa(8)

Copied to clipboard