Operating System - HP-UX
1837523 Members
3537 Online
110117 Solutions
New Discussion

Checking Total uptime of system

 
SOLVED
Go to solution
Khurram_4
Occasional Contributor

Checking Total uptime of system

Hi All,
Is there any command to check the total uptime of the system fromlast reboot.
Regards
Khurram
Knowledge is Curse
15 REPLIES 15
James R. Ferguson
Acclaimed Contributor
Solution

Re: Checking Total uptime of system

Hi Khurram:

# uptime

...gives the uptime from last boot

# who -b

...gives you the actual boot date/time

Regards!

...JRF...
Ian Dennison_1
Honored Contributor

Re: Checking Total uptime of system

command 'uptime'.

Easy peasey, Ian
Building a dumber user
T G Manikandan
Honored Contributor

Re: Checking Total uptime of system

#uptime
Ken Hubnik_2
Honored Contributor

Re: Checking Total uptime of system

Just key in uptime.
Hai Nguyen_1
Honored Contributor

Re: Checking Total uptime of system

Khurram,

Try this:

# uptime

or:

# who -r

Hai
Massimo Bianchi
Honored Contributor

Re: Checking Total uptime of system

uptime... ops, there is an echo ?!?!


You guys, do you know all of you post the reply in the same minute ? It must be a record...


Massimo

Hai Nguyen_1
Honored Contributor

Re: Checking Total uptime of system

Khurram,

This should tell you the uptime as well.

# w

Hai
T G Manikandan
Honored Contributor

Re: Checking Total uptime of system

Also check the timestamp of OLDsyslog.log file in /var/adm/syslog dir

#ls -l /var/adm/syslog/OLDsyslog.log.

This should give the last timestamp of the previous syslog file.

ALso,

#cat syslog.log |head -1
Jannik
Honored Contributor

Re: Checking Total uptime of system

last boot:
/etc/rc.log
the time before last:
/etc/rc.log.old

This is just another way, but i would think that you are lokking for uptime or who -b as others said.

BR
jaton
Pete Randall
Outstanding Contributor

Re: Checking Total uptime of system

ps -ef |grep init would also work, but uptime is the way to go.

When I first saw this, I thought it was a Lubomir question!!!!! ;^)


Pete



Pete
Chris Wilshaw
Honored Contributor

Re: Checking Total uptime of system

You can get the history of reboots by checking /etc/shutdownlog.

If the file doesn't exist, you can create it using

touch /etc/shutdownlog

Once this is done, any future reboots (including some crashes/system panics) will be logged.

eg:

/etc =>more shutdownlog
08:10 Wed Jun 11, 2003. Reboot:
09:02 Wed Jun 11, 2003. Reboot:
09:14 Wed Jun 11, 2003. Reboot:
10:19 Wed Jun 11, 2003. Reboot:
10:32 Wed Jun 11, 2003. Reboot:
13:58 Wed Jun 11, 2003. Reboot:
13:58 Wed Jun 11, 2003. Reboot:
15:45 Wed Jun 11, 2003. Reboot:
07:55 Thu Jun 12, 2003. Reboot:
07:55 Thu Jun 12, 2003. Reboot:
10:50 Thu Jun 12 2003. Reboot after panic:
16:15 Thu Jun 12, 2003. Reboot:
11:53 Fri Jun 13, 2003. Halt:
12:28 Fri Jun 13, 2003. Halt:
Hai Nguyen_1
Honored Contributor

Re: Checking Total uptime of system

Just for fun. Here is another way:

# last reboot | head -1

Hai
twang
Honored Contributor

Re: Checking Total uptime of system

use the following command to find out how long the system has being up and its svg loading:
# uptime

Caesar_3
Esteemed Contributor

Re: Checking Total uptime of system

Hello!

As you say uptime so it's the name of the command that shows the uptime of the machine after the last reboot.

Caesar
yogesh_4
Regular Advisor

Re: Checking Total uptime of system

In your question itself there is answer. #uptime or #who -b will show you the system uptime.