You are not logged in.
I'm curious to know what time my system lost power, whats a good way to tell? I have been checking the logs to get the last entry times but was curioius if there were other methods of telling when the box's power was interrupted?
Offline
I suppose if it suddenly lost power then, no.
If it was shutdown then yes.
cat /var/log/user.log
Offline
Sometimes there's a setting in BIOS to boot the system whenever it has power, which will give you a rough estimate of when it went down.
Offline
Planned reboots:
last reboot
Last edited by lucke (2009-08-29 03:51:04)
Offline
You can use the MARK lines in /var/log/everything.log to get it down to a twenty minute slice, probably.
Offline
I'm curious to know what time my system lost power, whats a good way to tell? I have been checking the logs to get the last entry times but was curioius if there were other methods of telling when the box's power was interrupted?
A rather ghetto way of doing it:
#!/bin/bash
log="/var/log/uptime-poll"
pollsecs=10
echo $$ > /var/run/uptime-poll.pid
if [[ -f "$log.tmp" ]]; then
echo "Lost power at: `cut -d';' -f2 "$log.tmp"`" >> "$log.log"
fi
while :; do
date +'%s;%D %T' > "$log.tmp"
sleep $pollsecs
done
...and in /etc/rc.local.shutdown...
killall $(cat /var/run/uptime-poll.pid)
rm /var/run/uptime-poll.pid
rm /var/log/uptime-poll.tmp
Last edited by Wintervenom (2009-08-29 06:37:29)
Offline