Date: Mon, 17 Apr 2000 20:28:38 +0100 From: Ben Smithurst <ben@scientia.demon.co.uk> To: Chuck Bacon <crtb@capecod.net> Cc: questions@freebsd.org Subject: Re: We have 'uptime' - is there a 'downtime' ? Message-ID: <20000417202838.M23900@strontium.scientia.demon.co.uk> In-Reply-To: <200004171627.MAA00583@capecod.net> References: <200004171627.MAA00583@capecod.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Chuck Bacon wrote: > Is there some timestamp which a FreeBSD system periodically leaves > someplace on a disk? If so, then when it reboots, it might be able > to report the down time. You could look at 'last'. You should see entries like: reboot ~ Fri 14 Apr 22:48 shutdown ~ Fri 14 Apr 22:39 If the system was not shutdown cleanly (i.e. a panic, power failure, etc) you won't see the "shutdown" line. You could create a timestamp every minute with cron, just do 'touch /var/log/timestamp' or something and then check the mtime at boot time. Even with 'last' you can't get seconds, so you'd have to read /var/log/wtmp yourself, see utmp(5) for the format. -- Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000417202838.M23900>