How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

tuptime – Shows Historical and Statistical Running Time of Linux Systems

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
77
VIEWS
Share on FacebookShare on Twitter

Contents

  1. What is tuptime?
  2. Requirements
  3. How to Install tuptime in Linux
  4. How do I use tuptime?
  5. Summary

System Administration involves many activities one of which is monitoring and checking for how long your Linux system has been running. It is always a good idea to keep track of system uptime in order to optimize the use of system resources.

tuptime – Shows Historical and Statistical Running Time of Linux Systems

tuptime – Shows Historical and Statistical Running Time of Linux

In this guide, we shall look at a Linux tool called tuptime that can help System Administrators to know for how long a Linux machine has been up and running.

What is tuptime?

tuptime is a tool used for reporting the historical and statistical running time (uptime) of a Linux system, which keeps it between restarts. This tool works more less like the uptime command but though it provides a more advanced output.

This command line tool can:

  1. Register used kernels.
  2. Register the first boot time.
  3. Count system startups.
  4. Count good and bad shutdowns.
  5. Calculate uptime and downtime percentage since first boot time.
  6. Calculate the largest, shortest and average uptime and downtime.
  7. Calculate the accumulated system uptime, downtime and total.
  8. Print current uptime.
  9. Print formatted table or list with most of the previous values stored.

Requirements

  1. Linux or FreeBSD OS.
  2. Python 2.7 or 3.x installed but latest version is recommended.
  3. Python modules (sys, os, optparse, sqlite3, datetime, locale, platform, subprocess, time).

How to Install tuptime in Linux

First you need to clone the repository by running the command below:

$ git clone https://github.com/rfrail3/tuptime.git
tuptime – Shows Historical and Statistical Running Time of Linux Systems

Clone tuptime Tool

Then move into the latest directory inside the tuptime directory. Next, copy tuptime script inside the latest directory to /usr/bin and set executable permission as shown.

$ cd tuptime/latest 
$ sudo cp tuptime /usr/bin/tuptime
$ sudo chmod ugo+x /usr/bin/tuptime
tuptime – Shows Historical and Statistical Running Time of Linux Systems

Configure tuptime

Now, copy the cron file tuptime/latest/cron.d/tuptime to /etc/cron.d/tuptime and set executable permission as follows.

$ sudo cp tuptime/latest/cron.d/tuptime /etc/cron.d/tuptime
$ sudo chmod 644 /etc/cron.d/tuptime
tuptime – Shows Historical and Statistical Running Time of Linux Systems

Configure tuptime Cron

If you followed above these steps correctly, then it must be installed on your system at this point.

How do I use tuptime?

Next we shall look at how to use this tool for certain system administration activities by running it with different options as a privileged user as shown.

1. When you run tuptime without any options, you get a display screen similar to the one below.

# tuptime
tuptime – Shows Historical and Statistical Running Time of Linux Systems

tuptime in action

2. You can display output with date and time as follows.

# tuptime --date='%H:%M:%S %d-%m-%Y'
tuptime – Shows Historical and Statistical Running Time of Linux Systems

tuptime date and time

3. To print system life as a list, you can run this command below:

# tuptime --list
tuptime – Shows Historical and Statistical Running Time of Linux Systems

Check Linux Uptime

4. You can create an alternative database file as follows. The database will be created in a SQLite format.

# tuptime --filedb /tmp/tuptime_testdb.db
tuptime – Shows Historical and Statistical Running Time of Linux Systems

tuptime Database

5. To order output information by end state of poweroff run this command.

# tuptime --end --table
tuptime – Shows Historical and Statistical Running Time of Linux Systems

Check Linux Last Shutdown

Some other options used with the tuptime tool as follows:

  1. To print the system kernel version in the output, use the --kernel option.
  2. To register a gracefully system shutdown, use the --gracefully option. It allows you to know whether the system shutdown was good or bad.
  3. To display output after a given number of seconds and epoch, use the --seconds option.
  4. You can also order output information by offtime or downtime by using the –offtime option. Use this option with --time or --list.
  5. To print detailed output information while running the command, use --verbose option.
  6. You can view help information by using --help option and --version to print the version of tuptime you are using.

Summary

In this article, we have looked at ways of using tuptime command for System Administration activities. This command is simple to use and if you do not understand any point in the guide, you can post a comment or add more information what I have put together. Remember to stay connected to Tecmint.

References: tuptime home page

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install Apache Tomcat 8 on CentOS 7
Linux

How to Install Apache Tomcat 8 on CentOS 7?

February 11, 2020
Install Arch Linux With Btrfs Snapshotting
Uncategorized

Install Arch Linux With Btrfs Snapshotting

February 13, 2020
Next Post

How to Recover a Deleted File in Linux

51 Useful Lesser Known Commands for Linux Users

Tips to Create ISO from CD, Watch User Activity and Check Memory Usages of Browser

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

Fatcow Review

Fatcow Review

4 years ago

4 Ways to Batch Convert Your PNG to JPG and Vice-Versa

4 years ago

Enhancing Security for FreeBSD Using IPFW and SSHGuard

3 years ago

How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

4 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.