From owner-freebsd-questions Mon Apr 17 13: 2:43 2000 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id AD44C37B96E for ; Mon, 17 Apr 2000 13:02:36 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.12 #1) id 12hHCI-000N3l-00; Mon, 17 Apr 2000 20:28:38 +0100 Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.12 #7) id 12hHCI-000J0L-00; Mon, 17 Apr 2000 20:28:38 +0100 Date: Mon, 17 Apr 2000 20:28:38 +0100 From: Ben Smithurst To: Chuck Bacon Cc: questions@freebsd.org Subject: Re: We have 'uptime' - is there a 'downtime' ? Message-ID: <20000417202838.M23900@strontium.scientia.demon.co.uk> References: <200004171627.MAA00583@capecod.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200004171627.MAA00583@capecod.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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