LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2011, 03:56 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
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.

Last edited by pinga123; 05-11-2011 at 03:58 AM.
 
Old 05-11-2011, 09:28 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Quote:
Originally Posted by pinga123 View Post
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
I am not sure if you have pasted the output correctly because I ran the commands that you have mentioned here on my RHEL as well as Linux Mint system and it is showing up the correct time.

Apart from that your system is showing as up from 19 hours 46 minutes:

Code:
reboot   system boot  2.6.18-194.el5   Tue May 10 17:35          (19:46)
Your uptime should show as:

Code:
13:22:40 up 19:47 min,  4 users,  load average: 1.23, 2.48, 2.66
I think you missed 19 there in the output there will be a minute or two difference because your system got rebooted a minute or two before it came backup.

Another way round use following commands:

last reboot: Check the first line and the time mentioned in ( )
uptime: Check the output with the time mentioned in ( ) of last reboot there will be a minute or two difference thats it.

I guess that answers your query.



Re-run the commands and I guess you will see the correct output.

Last edited by T3RM1NVT0R; 05-11-2011 at 09:36 PM.
 
1 members found this post helpful.
Old 05-11-2011, 09:38 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
The time in "who -b" shows you when the system went down; there's
nothing to say that it wasn't turned off for half a day.

You can always check details in syslog/messages.

Cheers,
Tink

Last edited by Tinkster; 05-11-2011 at 09:39 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
init uptime longer than system uptime? m4rtin Linux - Server 1 09-15-2010 08:45 AM
System uptime sfskseg32 Programming 1 12-06-2009 06:22 PM
[SOLVED] idle time greater than uptime mcguire Linux - Newbie 2 10-22-2009 02:08 PM
Dual Boot System Fight over system Time TuxLives Mandriva 8 02-14-2008 10:51 AM
System Uptime mindjet SUSE / openSUSE 7 05-15-2006 03:35 AM


All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration