Solved

Boot Time

Posted on 2001-07-03
7
190 Views
Last Modified: 2010-04-21
How to get boot time of a machine directly from a kernel.

who -b
gives me the last reboot time. but I would like to get it from Kernel.

I'm using DYNIX/PTX
0
Comment
Question by:prashant_n_mhatre
  • 4
  • 3
7 Comments
 
LVL 14

Expert Comment

by:chris_calabrese
Comment Utility
The kernel couldn't care less when the system booted and can not tell you.  This is a basic premise of Unix systems.  The kernel does what it needs to, and nothing else.
0
 
LVL 4

Author Comment

by:prashant_n_mhatre
Comment Utility
Then how to get boot time in C program?
0
 
LVL 14

Expert Comment

by:chris_calabrese
Comment Utility
This information is kept in the wtmp file.  See the wtmp man page.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Author Comment

by:prashant_n_mhatre
Comment Utility
I read it but wtmp doesn't talk about boot time.
0
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 65 total points
Comment Utility
wtmp will record boot entries with ut_type=BOOT_TIME
0
 
LVL 4

Author Comment

by:prashant_n_mhatre
Comment Utility
Thanks chris_calabrese
0
 
LVL 14

Expert Comment

by:chris_calabrese
Comment Utility
You're welcome.  Glad to help.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now