Operations 9 min read

How to Install and Use uptimed to Track Linux System Uptime

This guide explains how to install the uptimed daemon on various Linux distributions, enable and start its service, and use the uprecords command with its many options to view detailed system uptime, boot, and downtime histories.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Install and Use uptimed to Track Linux System Uptime

Uptimed is a daemon that records system uptime, longest run, and reboot timestamps, providing a concise summary via the uprecords command.

Installation

Arch Linux: sudo pacman -S uptimed Debian/Ubuntu/Linux Mint (universe repository must be enabled on Ubuntu): sudo apt-get install uptimed Enable the universe repository on Ubuntu if needed: sudo add-apt-repository universe Fedora: sudo dnf install uptimed CentOS 7 (requires EPEL):

sudo yum install epel-release
sudo yum install uptimed

If a package is unavailable, compile from source:

# wget https://github.com/rpodgorny/uptimed/archive/v0.4.2.zip -O uptimed.zip
# unzip uptimed.zip
# cd uptimed-0.4.2/
# ./configure
# make
# make install

Enable and start the daemon:

# systemctl enable uptimed
# systemctl start uptimed

Verify that the service is running:

# systemctl status uptimed
● uptimed.service - Uptime record tracking daemon
   Loaded: loaded (/usr/lib/systemd/system/uptimed.service; disabled; vendor preset: disabled)
   Active: active (running) …
   Docs: man:uptimed(8) man:uprecords(1)
   Main PID: 1435 (uptimed)

Using uptimed

Display the recorded uptime summary: # uprecords Common uprecords options: -b – sort records by boot time (oldest first). -B – sort by boot time (newest first). -m COUNT – limit output to the most recent COUNT entries (default 10). -w – wide output, showing full kernel information. -d – display shutdown time instead of kernel info. -? – show the full help message.

Examples:

Sort by boot time ascending: # uprecords -b Sort by boot time descending: # uprecords -B Show the latest 20 records: # uprecords -m 20 Wide output with full kernel version: # uprecords -w Display shutdown timestamps: # uprecords -d Full list of flags (output of uprecords -?):

usage: uprecords [OPTION]...
  -?      this help
  -a      do not print ansi codes
  -b      sort by boottime
  -B      reverse sort by boottime
  -k      sort by sysinfo
  -K      reverse sort by sysinfo
  -d      print downtime instead of system
  -c      do not show current entry if not in top entries
  -f      run continuously in a loop
  -s      do not print extra statistics
  -w      wide output (more than 80 cols per line)
  -i INTERVAL  use INTERVAL seconds for loop instead of 5, implies -f
  -m COUNT    show a maximum of top COUNT entries instead of 10
  -M      show next milestone
  -v      version information

For detailed usage, consult the manual page:

# man uprecords
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxsystem-monitoringuptimeuptimed
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.