Difference between system uptime and last boot time.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Difference between system uptime and last boot time.
# 1  
Old 05-11-2011
Difference between system uptime and last boot time.

My Linux system was last rebooted few hours ago.

But it seems little confusing for me to figure out the exact reason behind it.

I guess following command should justify what i meant to say.

Code:
# date
Wed May 11 13:22:49 IST 2011
# last | grep "May 10"
reboot   system boot  2.6.18-194.el5   Tue May 10 17:35          (19:46)
root     pts/1        XXXX    Tue May 10 17:24 - 18:18  (00:53)
# last | grep "May 11"
oracle   pts/2       XXX Wed May 11 13:08   still logged in
root     pts/1        XXX Wed May 11 13:07   still logged in
root     pts/0        XXX Wed May 11 13:00   still logged in
root     pts/5        XXX    Wed May 11 12:59 - 12:59  (00:00)
root     pts/4        XXX    Wed May 11 12:58 - 12:59  (00:00)
oracle   pts/3        XXX Wed May 11 12:44   still logged in
root     pts/2        XXXX    Wed May 11 12:42 - 12:59  (00:16)
root     pts/1        XXX    Wed May 11 12:41 - 12:59  (00:18)
root     pts/0        XXXX    Wed May 11 12:38 - 12:59  (00:20)
# uptime
 13:22:40 up 47 min,  4 users,  load average: 1.23, 2.48, 2.66
# who -b
         system boot  2011-05-10 17:35

You can see the current system date is Wed May 11 13:22:49 IST 2011
and last boot date is
system boot 2011-05-10 17:35

My question is Why the uptime is saying that the system is up since last 47 min.It should be more than 1 day if i m not wrong.

Correct me.
# 2  
Old 05-11-2011
Hi, it is also strange that the time shown by the uptime is actually in the past as per the date command.
Below an output from one of our Linux testing machines:

Code:
[jira@frodo ~]$ date; last reboot; uptime
Wed May 11 12:11:57 EEST 2011
reboot   system boot  2.6.18-194.3.1.e Mon May  9 00:00         (2+12:11)   

wtmp begins Sun May  8 03:05:01 2011
 12:11:57 up 2 days, 12:12,  6 users,  load average: 13.40, 13.99, 13.48

As seen also, the output from your "system reboot" says that it was done 19:46 hours ago.
Could you please post the result of the commands as per my example?

Thank you.
# 3  
Old 05-11-2011
Quote:
Originally Posted by sagoiz
Hi, it is also strange that the time shown by the uptime is actually in the past as per the date command.
Below an output from one of our Linux testing machines:

Code:
[jira@frodo ~]$ date; last reboot; uptime
Wed May 11 12:11:57 EEST 2011
reboot   system boot  2.6.18-194.3.1.e Mon May  9 00:00         (2+12:11)   

wtmp begins Sun May  8 03:05:01 2011
 12:11:57 up 2 days, 12:12,  6 users,  load average: 13.40, 13.99, 13.48

As seen also, the output from your "system reboot" says that it was done 19:46 hours ago.
Could you please post the result of the commands as per my example?

Thank you.
Please find the output as requested.
Code:
# date; last reboot; uptime
Wed May 11 15:47:52 IST 2011
reboot   system boot  2.6.18-194.el5   Tue May 10 17:35          (22:12)
reboot   system boot  2.6.18-194.el5   Wed May  4 17:21         (6+22:26)
reboot   system boot  2.6.18-194.el5   Tue May  3 07:42         (2+04:20)
reboot   system boot  2.6.18-194.el5   Wed Apr 27 22:12         (5+09:18)
reboot   system boot  2.6.18-194.el5   Wed Apr 27 13:57         (5+17:34)
reboot   system boot  2.6.18-194.el5   Tue Apr 26 12:06          (20:17)
reboot   system boot  2.6.18-194.el5   Wed Apr 20 18:48         (6+12:07)
reboot   system boot  2.6.18-194.el5   Wed Apr 20 18:09          (00:38)
reboot   system boot  2.6.18-194.el5   Thu Apr  7 10:45         (13+07:17)
reboot   system boot  2.6.18-194.el5   Tue Apr  5 23:55         (1+10:47)
reboot   system boot  2.6.18-194.el5   Wed Apr  6 04:50          (-5:-1)
reboot   system boot  2.6.18-194.el5   Tue Apr  5 04:01          (19:12)
reboot   system boot  2.6.18-194.el5   Mon Mar 28 18:58         (8+02:37)
reboot   system boot  2.6.18-194.el5   Sun Mar 27 18:15          (19:09)
reboot   system boot  2.6.18-194.el5   Sat Mar 12 18:19         (15+18:02)
reboot   system boot  2.6.18-194.el5   Mon Feb 28 15:54         (27+20:27)
reboot   system boot  2.6.18-194.el5   Sat Feb 26 12:43         (2+03:00)
reboot   system boot  2.6.18-194.el5   Sat Feb 26 11:56          (00:38)
reboot   system boot  2.6.18-194.el5   Thu Feb 24 14:43         (1+21:09)
reboot   system boot  2.6.18-194.el5   Thu Feb 24 14:07          (00:30)
reboot   system boot  2.6.18-194.el5   Mon Feb 21 17:08         (2+20:55)
reboot   system boot  2.6.18-194.el5   Sun Feb 13 18:57         (7+21:58)
reboot   system boot  2.6.18-194.el5   Thu Feb 10 19:42         (2+17:41)
reboot   system boot  2.6.18-194.el5   Wed Feb  2 09:41         (9+03:32)
reboot   system boot  2.6.18-194.el5   Mon Jan 31 20:41         (1+17:21)
reboot   system boot  2.6.18-194.el5   Mon Jan 31 14:05          (23:32)
reboot   system boot  2.6.18-194.el5   Mon Jan 31 06:01          (02:32)
reboot   system boot  2.6.18-194.el5   Tue Jan 25 03:46         (6+04:47)
reboot   system boot  2.6.18-194.el5   Mon Jan 24 21:36          (00:37)
reboot   system boot  2.6.18-194.el5   Thu Jan 20 03:23          (01:43)
reboot   system boot  2.6.18-194.el5   Thu Jan 20 03:10          (00:11)
reboot   system boot  2.6.18-194.el5   Sat Nov 13 08:58          (00:02)
reboot   system boot  2.6.18-194.el5   Sat Nov 13 08:48          (00:07)
reboot   system boot  2.6.18-194.el5   Sat Nov 13 07:24          (01:12)
reboot   system boot  2.6.18-194.el5   Fri Nov 12 22:35          (00:06)
reboot   system boot  2.6.18-194.el5   Sat Nov 13 03:59          (-5:-24)
reboot   system boot  2.6.18-194.el5   Sat Nov 13 03:49          (00:09)
reboot   system boot  2.6.18-194.el5   Sat Nov 13 03:43          (00:04)
reboot   system boot  2.6.18-194.el5   Fri Nov 12 16:43          (05:28)

wtmp begins Fri Nov 12 16:43:22 2010
 15:47:52 up  3:12,  3 users,  load average: 2.08, 2.10, 2.18

# 4  
Old 05-11-2011
The only explanation that comes to mind is that your system was booted and set itself initially to the wrong time. Then NTP started running and found that it needed to move your clock backwards to set things right.
# 5  
Old 05-11-2011
I agree with Perderabo.
Your hardware clock would appear to be exactly 19 hours slow.

What is the value of the timezone environment variable $TZ ?
# 6  
Old 05-12-2011
It was a problem with Host Server due to which vm guest were getting wrong time.
Host server clock was not set correctly.
This User Gave Thanks to pinga123 For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Managed system's uptime

How to find Physical server uptime from HMC/ ASMI. Server was in standby mode. We have started the Lpar manually. Server rebooted automatically but no information updated in Lpars's errpt, alog.console or HMC prior to the reboot. (1 Reply)
Discussion started by: sunnybee
1 Replies

2. Red Hat

Difference between uptime and who -b

Hi Folks, I have been checking on a redhat server for patching, when I tried the output for uptime and who -b both are not matching. I do not know the reason what happened and why it seems like this. Please assist someone and explain in detail. I would appreciate if I get the right... (5 Replies)
Discussion started by: seenuvasan1985
5 Replies

3. Solaris

Precise system uptime??

OK folks, my first post here.. hope the community can come up with a clever solution. Cross posting this in the Solaris and Shell scripting forums, as problem is scripting problem specifically on Solaris platform. I am trying to detect a host's uptime with greater precision than is offered up... (1 Reply)
Discussion started by: Yeaboem
1 Replies

4. Shell Programming and Scripting

Solaris, Perl, and precise system uptime??

OK folks, my first post here.. hope the community can come up with a clever solution. Cross posting this in the Solaris and Shell scripting forums, as problem is scripting problem specifically on Solaris platform. I am trying to detect a host's uptime with greater precision than is offered up... (1 Reply)
Discussion started by: Yeaboem
1 Replies

5. Solaris

Finding system uptime without login

Hi, Am writing a script where I want to find uptime of certain servers. Is there any command where we can find uptime without login to the server, since the server list is big logging to the server will time consuming. Thanks in advance (7 Replies)
Discussion started by: rogerben
7 Replies

6. Shell Programming and Scripting

Time difference between two time stamps

Hi Friends, I have 2 varaibles which contain START=`date '+ %m/%d/%y %H:%M:%S'` END=`date '+ %m/%d/%y %H:%M:%S'` i want the time difference between the two variables in Seconds. Plz help. (2 Replies)
Discussion started by: i150371485
2 Replies

7. Solaris

uptime command not showing how long the system has been up

Hello folks, uptime command not shows how long the system has been up. I know it come from a corruption of /var/adm/utmpx file. I've done : cat /dev/null > /var/adm/utmpx Now who and last commands work fine. But uptime still give me back an answer without the "up time". In which... (6 Replies)
Discussion started by: gogol_bordello
6 Replies

8. Shell Programming and Scripting

Extract the uptime from the output of the uptime command

Hi! I want to extract the uptime from the output of the uptime command. The output: 11:53 up 3:02, 2 users, load averages: 0,32 0,34 0,43 I just need the "3:02" part. How can I do this? Dirk (6 Replies)
Discussion started by: Dirk Einecke
6 Replies

9. Shell Programming and Scripting

How to calculate time difference between start and end time of a process!

Hello All, I have a problem calculating the time difference between start and end timings...! the timings are given by 24hr format.. Start Date : 08/05/10 12:55 End Date : 08/09/10 06:50 above values are in mm/dd/yy hh:mm format. Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies

10. Shell Programming and Scripting

get only the up time from uptime command

Hi all,:o i am new to shell scripting and i have aproblem like i just want to extractthe uptime of the system from an uptime command which gives the output as the Current time , how long the system has been running,how many users are surrently logged on and the system load averages for past 1,5,... (5 Replies)
Discussion started by: tulip
5 Replies
Login or Register to Ask a Question