ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

accurate log file of uptime - even if power turned off

(1/1)

Steven Avery:
Hi Folks,

  Most up-time measurement tools are for screen display, or for a network monitoring.  If you try to measure uptime on a local puter and put the info to a log file you have the problem of a BSOD or power-off that is a disorderly shutdown of the program.   They will have a start time but no end time, thus no total time.

  Thus one design would be to have a polling and update the end time every interval (e.g. a minute) and update the end time so that even in a power off .. the info is there -- "The puter was up from 12:00 to 5:00".  It would be nice if the report knew whether a Windows orderly shutdown was in process at the final polling, and marked the distinction, however that is a nicety. 

  An alternative would be to have the polling done by another puter on the network (e.g. a home computer shared behind the router) which presumably is on 24/7.

   My puter that is having the BSOD would use this, I would like to know how long it stays up (it can BSOD even when nothing is apparently happening, or it can stay happy through hard work).

   Do you know anything that exists for an accurate log of uptime -- that works even if the power is turned off ?

   If the log includes other information about activity, so much the better, however I am wondering if there is a program that covers the simple thing first.

Shalom,
Steven Avery

 

MilesAhead:
You could probably use any launcher that has a periodic launch capability.
A simple .cmd batch file should be all you need.
Something like:
echo %date%  %time% >KillTime.txt

every time the batch runs it would overwrite KillTime.txt with the last
date & time.

Also it might be a good idea to flush the hard drive buffers so that the file
gets written after each iteration.  The free sync.exe from Sysinternals.com
should do it.  After the echo line just add the line sync.exe.  It just locks the
drive to force all write buffers to be flushed to the hardware.

AndyM:
or change ">KillTime.txt" to ">>KillTime.txt" so you append the date/time to the file

4wd:
Providing you don't clear out your Event Log too often then use the handy-dandy Uptime command from your friends at Microsoft :)

uptime /s will give you all the time/date of all boots/shutdowns, Total Reboots, Meantime Between Reboots, Total BSODs, System Availability, lots of other things plus Total Uptime since the start of the log.

And it will work across a network.

Use uptime /help for more info on what it can and can't do, especially the heartbeat function which may suffice for what you require.

UPTIME, Version 1.01
(C) Copyright 1999, Microsoft Corporation

Uptime [server] [/s ] [/a] [/d:mm/dd/yyyy | /p:n] [/heartbeat] [/? | /help]
        server          Name or IP address of remote server to process.
        /s              Display key system events and statistics.
        /a              Display application failure events (assumes /s).
        /d:             Only calculate for events after mm/dd/yyyy.
        /p:             Only calculate for events in the previous n days.
        /heartbeat      Turn on/off the system's heartbeat
        /?              Basic usage.
        /help           Additional usage information.
--- End quote ---

MilesAhead:
or change ">KillTime.txt" to ">>KillTime.txt" so you append the date/time to the file
-AndyM (April 03, 2009, 05:20 PM)
--- End quote ---

I don't see the advantage.  The last one is the only one that matters.  Also overwriting keeps the file small.

Navigation

[0] Message Index

Go to full version