Questions tagged [uptime]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
57 views

Convert string time to seconds

I'm receiving an uptime in this format: 167h58m10.586582048s I want to transform it to seconds and discard the fraction part. I know awk could do that if only the received string had the same ...
user avatar
0 votes
0 answers
26 views

What is the most efficient way to run a task every X hours of runtime, accumulated over all power-ons?

Let us assume that I have a machine which wakes up at 7:00, does some work, usually for 15 minutes, but sometimes for days (e.g., experiment supervision), and after the works is done, it powers ...
user avatar
1 vote
0 answers
67 views

Format the output of "read_file uptime" in i3status

I'm trying to display my system uptime with i3status. This is what I have in my i3status.conf file: read_file uptime { format = "%title: %content" path = "/proc/uptime" } ...
user avatar
  • 11
1 vote
1 answer
65 views

Is it possible to detect that an impending shutdown (or reboot) is in progress?

I'm trying to write a script in bash that I intend to start on system startup and end on system shutdown. The idea is to create a system uptime tracker for myself. For the purpose, I want to save the ...
user avatar
1 vote
1 answer
163 views

last reboot and who -b shows different results?

I am using the following 3 commands to check the latest time point when my computer is rebooted: last reboot who -b uptime The result for last reboot is: wtmp begins Sat Oct 9 04:49:27 2021 The ...
user avatar
  • 181
0 votes
0 answers
27 views

Get information about Reboot, Sleep, Awake, Shutdown, Hibernate

I'm trying to figure out a way of gathering information about events related to Reboot, Sleep, Awake, Shutdown, Hibernate in the last n days. I was able to achieve that on ubuntu (20+) via journalctl ...
user avatar
  • 101
2 votes
1 answer
181 views

Why jiffies/HZ does not match uptime?

System uptime is stored in /proc/uptime. As you know, the Linux kernel has a jiffies variable which increments by each timer interrupt specified by the HZ parameter. I got the value ofHZ by the ...
user avatar
  • 121
0 votes
5 answers
513 views

How to check if uptime is greater than 72h?

I need to create a script that will execute daily (cron job), calculate the uptime of the system, and if that number is greater than 72 hours, reboot the system. I am getting lost in converting the ...
user avatar
  • 111
0 votes
3 answers
33 views

Unable to get the nth column data due to changing output of uptime command

Below is the output of uptime from Solaris where I am extracting the third last column: uptime 8:30pm up 23 day(s), 17:46, 5 users, load average: **2.79**, 1.79, 1.53 I always need to get the ...
user avatar
  • 297
0 votes
0 answers
52 views

machine uptime is not consistent with last command

we have 3 rhel servers version 7.6 ( part of cluster with 8 machines ) on rhel server 1 machine uptime is uptime 10:25:51 up 23:48, 1 user, load average: 0.02, 0.09, 0.13 on rhel server 2 machine ...
user avatar
  • 10.9k
1 vote
1 answer
117 views

Uptime information updated in the command prompt

I want to put the uptime command information into the command prompt and have it updated every 750ms (regardless of whether I'm typing at the prompt or not). I usually use bash but I've used zsh too, ...
user avatar
  • 11
0 votes
1 answer
369 views

Get system uptime with better precision then seconds

My system is running Linux for embedded. At the moment I didn't sync the system clock or gave the user an option to do it but it's going to change. Different parts in my application are using ...
user avatar
  • 13
2 votes
0 answers
162 views

Understanding load average on Digital Ocean droplets

I apologize for this being a stupid question. I spend most of my time on stackoverflow and feel like a fish out of water over here. I have a standard Digital Ocean droplet, paying $5 a month, and ...
user avatar
0 votes
1 answer
159 views

Trying to calculate uptime and email if greater than a number of days

I need to create a script that will execute daily (cron job), calculate the uptime of the system (days only), and if that number is greater than a defined value (e.g. 30), email the system's ...
user avatar
0 votes
1 answer
73 views

System Uptime of last boot

If system shutdown abruptly. Then will it be possible to tell at what time it was shut ? Abruptly means due to power failure or due to sysrq magic keys. If I am logging something every few seconds ...
user avatar
  • 13.5k
0 votes
2 answers
788 views

How to get server uptime of AIX server results in seconds

In Linux, I can get the server uptime results in seconds (value) by using below command cat /proc/uptime But in AIX, we do not have uptime in /proc. If I just type uptime, I get results in days, ...
user avatar
  • 1
0 votes
1 answer
75 views

no1 record in uptimed report

I have recently installed uptimed to track history of when my electricity was off. Everything is clear but there's one thing I cannot decipher. What does the label "no1" stand for in the following ...
user avatar
  • 101
2 votes
1 answer
15k views

CPU load average + how to get cpu load average for history of X hours

We all know we can get average CPU load as: uptime 10:09:22 up 2 days, 1:44, 1 user, load average: 20.01, 20.03, 22.05 but this shows only load average over the last 1 minute is 22.05 load ...
user avatar
  • 10.9k
0 votes
1 answer
706 views

Incorrect System Uptime

Recently, in an Oracle Linux (either 6 or 7) based virtual machine, I faced any issue where system uptime was apparently wrong. # who -b system boot 2019-07-24 13:21 # last reboot reboot system ...
user avatar
1 vote
0 answers
53 views

Docker container started before host?

Look at the output: ubuntu@iBug-Server:~$ uptime -s 2019-07-07 20:33:07 ubuntu@iBug-Server:~$ docker inspect -f '{{ .State.StartedAt }}' ibot 2019-07-07T12:30:37.871925503Z ubuntu@iBug-Server:~$ ...
user avatar
  • 2,902
3 votes
0 answers
427 views

Uptime requires sudo password

I was wondering if anyone could give me some info on why does uptime keeps requiring sudo password? Indeed uptime runs without any sudo access from my trminal. $ id -u; uptime 1000 17:39:48 up 2:27,...
user avatar
  • 135
2 votes
0 answers
305 views

Why do my software RAID1 superblocks keep getting corrupted and how can I prevent this?

How might I be repeatedly corrupting my superblocks on RAID1 I have had two occasions in the past six months of RAID1 root arrays becoming unusable because of problems with the superblock. ...
user avatar
0 votes
2 answers
327 views

Replacing output with awk or sed

So what I've been trying to do is replace a certain output in bash with awk. But I can't seem to get it to work. I'm trying to replace the $6 output from "uptime" to 'user' instead of 'users'. How can ...
user avatar
0 votes
1 answer
217 views

Fix the output of uptime

So I've been experimenting with Bash not too long ago, and I want to manipulate the output from the "uptime" command. I managed to change the output of up x minutes to 0:05 for example if the up time ...
user avatar
1 vote
0 answers
148 views

Different output from uptime command

When I use the uptime command on my linux vb, it shows its output like this before it has been on for longer than 1 hour; 13:45:25 up 40 min, 3 users, load average: 0.41, 0.37, 0.27 But after the ...
user avatar
  • 11
0 votes
3 answers
175 views

Why is there a single space before the output of `uptime`?

Perhaps a trivial question, but I found myself in the situation of needing to strip the leading space off the output of uptime and it got me wondering why it was there in the first place. An example ...
user avatar
  • 268
1 vote
2 answers
466 views

High CPU load average; how to find the root cause?

It is hard task to find the root cause of CPU load average many commands are used to give partial picture. I am not sure if somewhere we can find a tool that knows how many CPU's we have on machine ...
user avatar
  • 10.9k
1 vote
2 answers
891 views

Most ironclad way to make root installation redundant and maximize uptime? RAID, ZFS or something else?

I would like to set up my desktop computer (which is actually a server for the KVM guests I do my actual work in) to have a redundant root installation. If one drive dies I want to quickly get back ...
user avatar
0 votes
2 answers
1k views

Finding the Percentage from a grep variable

I want to display the calculation of the CPU load in percentage. num2=$(uptime | grep "average:" | tr -d " " | cut -d ':' -f 5 | cut -d ',' -f 2) percent=$((num2(*100))) echo 'CPU percentage' $...
user avatar
  • 125
0 votes
2 answers
155 views

Find number of cores available in a given node

I need to fix the following piece of code. The code aims to determine the number of cores available in a given node. Step 1: Get the number of cores with TC=$(grep -c process /proc/cpuinfo) Step 2:...
user avatar
2 votes
3 answers
5k views

Convert linux uptime to well format date

I want to convert uptime to date DD:MM:YY without the | and I want to put a string like "the computer is on since 23-feb-16"
user avatar
  • 33
5 votes
2 answers
781 views

Uptime command misconception with suspend and resume states

The definition for uptime is "Tell how long the system has been running." but if you change your system power state to suspend or resume: # uptime 09:50:33 up 8 min, 2 users, load average: 0,24, 0,...
user avatar
  • 762
2 votes
2 answers
2k views

uptime Script help [closed]

I am looking to build a script that will log in to multiple servers using a host file and run uptime, hostname -I and hostname Script so far echo"" ; echo "hostname:" $(ssh $HOST hostname) ; echo "...
user avatar
  • 31
5 votes
1 answer
638 views

How is the "users" field of `uptime` calculated?

For me, uptime yields 9 users, but ps -Af | cut -f1 -d' ' | sort | uniq | wc -l yields 14. I'm not exactly sure where the 9 is coming from. Before I jump to conclusions though, please let me ...
user avatar
  • 1,073
3 votes
0 answers
412 views

Time of Last Power Cycle

I know how to use uptime To see how long the OS has been running, and last reboot To see a log of recent OS reboots. Is there an easy way to see when the box was last power cycled? The ...
user avatar
  • 131
0 votes
1 answer
945 views

Is it possible to calculate CPU utilization from load average & top CPU% column

I have a file which contains 2 output of uptime load average & CPU% column like an output from top command. So, is it possible to calculate it into CPU utilization or CPU usage at a time? ...
user avatar
  • 1
2 votes
1 answer
1k views

Monit alert/exec when host is back to normal

I use Monit to quick check uptime of Elasticsearch service. Here is my configuration: check host [Elasticsearch]-test with address 1.2.3.4 if failed port 9200 protocol http ...
user avatar
0 votes
1 answer
2k views

How to suppress Debian uname message when ssh'ing into the machine? Plus changing it to something else, if possible

I would love to get rid of this uname message when ssh'ing into the Debian 9 machine: Linux backup-server 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 This line I would like to ...
user avatar
7 votes
2 answers
3k views

Total runtime of machine

Is there any way to read total running time of a linux system from BIOS or CPU? I've searched BIOS informations by dmidecode. But it gives release date which is not proper for my question. Then I've ...
user avatar
  • 73
0 votes
2 answers
388 views

Linux Output Into Table

I have a cronjob that run monthly to generate some report from our system. However, the current output is as below: Uptime 100 45 50 Average CPU 2.36 15.6 70.8 How can I generate the output into a ...
user avatar
  • 3
5 votes
1 answer
2k views

getting uptime in Weeks, Days, Hours, Minutes

Basically I an using conky to ssh into an android tv box and get the uptime and display it on the conky screen. I have this so far, found on net and hacked by me but it works, please amend if its ...
user avatar
  • 163
2 votes
2 answers
3k views

How to display uptime in i3status bar?

I would like to display uptime in common units (so not just in minutes if it is over an hour; also not just in seconds if it is over a minute; e.g., "1:02:30" for 1 hour, 2 minutes and 30 seconds ...
user avatar
  • 3,273
3 votes
0 answers
168 views

What is the right time when linux suffer drift time?

Supose that a linux server, at startup, report the following btime: boot btime -> 1493875000 This server is virtualized inside a busy box and the I/O load is high, in spite of have ntp running, a ...
user avatar
  • 762
0 votes
1 answer
1k views

Get uptime for multiple Linux based Vms with powershell

Is there a way to find out the uptime for the Linux based Vms through powershell script. I am able to find the uptime for windows based VMs but I am unable to find uptime for the Linux based VMs.
user avatar
  • 119
3 votes
2 answers
2k views

CPU and Load Average Conflict on EC2 server

I am having touble understanding what server resource is causing lag in my Java game server. In the last patch of my game server, I updated my EC2 lamp server from apache2.2, php5.3, mysql5.5 to ...
user avatar
1 vote
4 answers
922 views

How to keep an 'uptime record' log in Debian?

Currently, I have my server output my uptime to a HTML page using: TIME=$(uptime -p) echo ""${TIME}"!" >> /var/www/html/index.new Which generates an output of: up 1 day, 1 hour, 2 minutes! ...
user avatar
  • 11
1 vote
1 answer
2k views

last reboot in local time zone?

Is there a way to tell this command to output the data in local time (not UTC)? last reboot Version: last --version last von util-linux 2.27.1
user avatar
  • 1,137
8 votes
2 answers
13k views

High load average: Which processes are waiting in the queue?

I have an Ubuntu server running Redis, which suffers from a high load problem. Forensics Uptime # uptime 05:43:53 up 19 min, 1 user, load average: 2.96, 2.07, 1.52 sar # sar -q 05:24:00 AM ...
user avatar
  • 2,373
2 votes
3 answers
95 views

How can I see when my PC was rebooted?

How can I see when my PC was rebooted? I need to know the last 10 times.
user avatar
  • 699
57 votes
3 answers
21k views

On Linux, when does "uptime" start counting from?

My computer says: $ uptime 10:20:35 up 1:46, 3 users, load average: 0,03, 0,10, 0,13 And if I check last I see: reboot system boot 3.19.0-51-generi Tue Apr 12 08:34 - 10:20 (01:45) And ...
user avatar
  • 7,023