06-17-2003
I don't use OS X, but the kernel variable is called boottime in most kernels. It is an integer as would be returned by the time() system call. Your process will need read permission on /dev/mem to read it. If you have adb you can use that to read it via a shell script.
I use "ps -fp 1" rather than "uptime" to see when a system booted.
Option 4 would be to find a file that is changed at boottime. Do your startup scripts keep a log? What was the last time that log changed? If no such file exists, add something to the startup scripts to record boottime.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi Folks
uptime
12:24pm up 2 days, 3:12, 4 users, load average: 0.00, 0.00, 0.00
what does the load average figure mean..
regards
Hrishy (2 Replies)
Discussion started by: xiamin
2 Replies
2. UNIX for Dummies Questions & Answers
On HP-UX, the 13th argument of uptime is sometime the load and sometime the word AVERAGE:???
14 Jun 06 5:00pm up 44 days, 54 mins, 0 users, load average: 0.00, 0.02, 0.03
14 Jun 06 5:15pm up 44 days, 1:09, 0 users, load average: 0.00, 0.01, 0.01
When the time is in minutes, then the load... (1 Reply)
Discussion started by: qfwfq
1 Replies
3. UNIX for Dummies Questions & Answers
hello folks!
how can I display just the uptime without the current time, the word "up", and the load averages using the uptime command or some other command I do not know about? (13 Replies)
Discussion started by: MastaFue
13 Replies
4. AIX
Hey guys!!
Was tring to figure out how to find the uptime of an HMC? Any clue
Bala (2 Replies)
Discussion started by: balaji_prk
2 Replies
5. Solaris
HI All,
I have problem with "uptime" on one of the sun server.(SunOS 5.9 Generic_118558-11 sun4u sparc SUNW,Sun-Fire-V240).when i am issuing uptime command its not showing uptime.even its not showing output for who -b.
$ uptime
11:01am 1 user, load average: 0.06, 0.04, 0.03
$ who -b
$... (3 Replies)
Discussion started by: jeevanbv
3 Replies
6. AIX
HELLO ALL
HOW CAN I CHECK HMC UPTIME :confused: :confused: VERSION 6 :D (7 Replies)
Discussion started by: kalaso
7 Replies
7. Shell Programming and Scripting
Hi,
I need some help about a script i need to write.
I want to check , if some specific process, are running since 2 hours.
I tried to use a loop , grep my pid and use find -ctime on /proc directory, to list what i need.
for i in `ps -ef |grep process |grep -v grep|awk '{print $2}'`... (2 Replies)
Discussion started by: rokerij
2 Replies
8. Linux
Hi All
is there a way that i can return uptime if the machine has been on for longer than 4 days
thanks
ab (3 Replies)
Discussion started by: ab52
3 Replies
9. Shell Programming and Scripting
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
10. War Stories
Hi All,
Having recently started a new job, a Data Center Migration in fact I have been tasked with looking at some of the older Solaris boxes when I came across this little gem.
nismas# uname -a
SunOS nismas 5.5.1 Generic_103640-27 sun4u sparc SUNW,Ultra-1
nismas# uptime
10:37am up 2900... (2 Replies)
Discussion started by: gull04
2 Replies
LEARN ABOUT DEBIAN
ns_server
ns_info(3aolserver) AOLserver Built-In Commands ns_info(3aolserver)
__________________________________________________________________________________________________________________________________________________
NAME
ns_info, ns_server, ns_stats - commands
SYNOPSIS
ns_info address
ns_info argv0
ns_info boottime
ns_info builddate
ns_info config
ns_info home
ns_info hostname
ns_info interp
ns_info label
ns_info log
ns_info name
ns_info pageroot
ns_info platform
ns_info server
ns_info tcllib
ns_info uptime
ns_info version
ns_server option ?arg arg ...?
ns_stats option ?arg arg ...?
_________________________________________________________________
DESCRIPTION
ns_info boottime
Returns the server boot time in seconds.
ns_info config
Returns the configuration file name.
ns_info home
Returns the directory where the AOLserver was installed.
ns_info hostname
Returns the name of the host on which server is running (e.g., www.myhost.com).
ns_info interp
Returns the number of the Tcl interpreter currently being used.
ns_info label
Returns the source code label for the server. If no label was used, "unlabeled" is returned.
ns_info log
Returns the location of the server log file (e.g., /home/myserver/log/server.log).
ns_info name
Returns the name of the AOLserver. It's usually "AOLserver."
ns_info pageroot
returns the directory containing the HTML pages for this virtual server.
ns_info platform
Returns the name of the platform that the server is running on (e.g., Solaris).
ns_info server
returns the name of this virtual server.
ns_info tcllib returns the directory where the AOLserver Tcl source code resides for this virtual server.
ns_info uptime returns the time in seconds that the server has been up.
ns_info version returns the version of the AOLserver.
SEE ALSO
nsd(1), info(n)
KEYWORDS
AOLserver 4.0 ns_info(3aolserver)