TUPTIME(1)

NAME
tuptime - Reports historical and statistical system uptime, preserved across reboots. Total uptime.

SYNOPSIS
tuptime [-h] [-A STARTUP] [-b] [-c] [-d DATETIME_FMT] [-e DECIMALS] [-E STARTUP] [-f FILE] [-g] [-i] [-k] [-l] [-n] [-o TYPE] [-p] [-q] [-r] [-s] [-S STARTUP] [-t] [--tat TIMESTAMP] [--tsince TIMESTAMP] [--tuntil TIMESTAMP] [-U STARTUP] [-v] [-V]

DESCRIPTION
Tuptime reports historical and statistical system uptime, preserved across reboots. Indeed, it can:

    - Count system startups
    - Register first boot time (since installation time)
    - Count graceful and accidental shutdowns
    - Uptime and downtime percentage since first boot time
    - Accumulated system uptime (running and sleeping), downtime and total
    - Register used kernels and boot IDs
    - Report current uptime
    - Print formatted table or list with the system history
    - Narrow reports since, until or at a given startup or timestamp
    - Output in csv format

OPTIONS

  ARGUMENTS
-h | --help | Show this help message and exit
-A | --at STARTUP | Limit to this startup number
-b | --bootid | Show boot identifier
-c | --csv | Output in csv format
-d | --date DATETIME_FMT | Datetime/timestamp format output
-e | --dec DECIMALS | Number of decimals in percentages
-E | --exclude STARTUP | Startup numbers to exclude, comma separated and target ranges with dash (e.g. '2,10-20,50')
-f | --filedb FILE | Database file (/var/lib/tuptime/tuptime.db)
-g | --graceful | Register a graceful shutdown
-i | --invert | Startup number in reverse count (for -t, -l, --tat) | switch between longest/shortest on default output
-k | --kernel | Show kernel version
-l | --list | Enumerate system life as list. Mutually exclusive with -t and --tat
-n | --noup | Avoid update values into DB
-o | --order TYPE | Order enumerate by [u|r|s|e|d|k]. Only works with -t or -l. (u = uptime | r = runtime | s = sleep time | e = end status | d = downtime | k = kernel)
-p | --power | Show power states run + sleep. Cannot be used in combination with --tsince, --tuntil or --tat
-q | --quiet | Update values into DB without output
-r | --reverse | Reverse order in listings. Only works with -t or -l
-s | --seconds | Output time in seconds and epoch
-S | --since STARTUP | Limit from this startup number
-t | --table | Enumerate system life as table. Mutually exclusive with -l and --tat
--tat TIMESTAMP | System status at epoch timestamp. Mutually exclusive with -l and -t
--tsince TIMESTAMP | Limit from this epoch timestamp
--tuntil TIMESTAMP | Limit until this epoch timestamp
-U | --until STARTUP | Limit up until this startup number
-v | --verbose | Verbose output
-V | --version | Show version

  ENVIRONMENT

TUPTIME_DBF
    Set an alternative database file path. The argument -f, --filedb takes precedence over this.

DEFAULT OUTPUT

System startups
    Total number of system startups since first timestamp available.

System shutdowns
    Total number of shutdowns done correctly or incorrectly.

System life
    Time counter since first startup timestamp available.

System uptime / System downtime
    Percentage of time and time counter.

Longest uptime / Longest downtime
    Time counter and date with the longest/shortest uptime/downtime register.

Average uptime / Average downtime
    Average time counter.

Current uptime
    Actual time counter and datetime since registered boot timestamp.

EXAMPLES

tuptime
    Default output.

tuptime -t
    Enumerate system life as table. Mutually exclusive with -l and --tat.

tuptime -l
    Enumerate system life as list. Mutually exclusive with -t and --tat.

tuptime -k
    Add kernel information to the output.

tuptime --csv
    Report in csv format.

tuptime -s
    Change default human readable datetime/timestamp style and print times in seconds and datetimes in epoch.

tuptime -d '%H:%M:%S %m-%d-%Y'
    Change the datetime/timestamp format. By default the output use the configured system locales.

tuptime --tsince -31557600
    Report since one year ago.

FILES
File paths may vary depending on the operating system and distribution.

/var/lib/tuptime/tuptime.db
    Default database file.

/etc/cron.d/tuptime
    Scheduled cron file.

/etc/init.d/tuptime
    Init file.

/usr/lib/systemd/system/tuptime.service
    Systemd service unit file. Register time values into database.

/usr/bin/tuptime
    Main and only executable file.

/usr/share/doc/tuptime/
    Directory with multiple documentation files.

/usr/lib/systemd/system/tuptime-sync.timer
    Systemd .timer unit for use instead of cron. Only executes tuptime-sync.service.

/usr/lib/systemd/system/tuptime-sync.service
    Systemd .service unit required by tuptime-sync.timer. Updates time values into database.

/usr/lib/sysusers.d/tuptime.conf
    Systemd sysusers configuration file for creating the _tuptime user.

/usr/share/man/man1/tuptime.1
    Manual page.

SEE ALSO

/usr/share/doc/tuptime/tuptime-manual.txt.gz
    Detailed documentation.

https://github.com/rfmoz/tuptime/
    Official repository.

REQUIREMENTS
Python 3.x

AUTHOR
Ricardo Fraile <r@rfmoz.eu>

COPYRIGHT
Copyright (C) 2026 by Ricardo F. All Rights Reserved.

This product is distributed in the hope that it will be useful, but WITHOUT any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS for a particular purpose.