Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2012 16:47:30 -0700
From:      Doug Hardie <bc979@lafn.org>
To:        Polytropon <freebsd@edvax.de>
Cc:        Fbsd8 <fbsd8@a1poweruser.com>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: find date of last boot
Message-ID:  <03962865-7560-43F4-B8E6-7F8652A1B488@lafn.org>
In-Reply-To: <20120608013325.d3eee7bb.freebsd@edvax.de>
References:  <4FD1360D.1060208@a1poweruser.com> <20120608013325.d3eee7bb.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help

On 7 June 2012, at 16:33, Polytropon wrote:

> On Thu, 07 Jun 2012 19:15:25 -0400, Fbsd8 wrote:
>> dmesg command does not show date of last boot.
>>=20
>> Are there some other commands to find date of last boot?
>=20
> Check the lines in /var/log/messages. Unless you're not
> experiencing a newsyslog message (new log file started),
> the "kernel: Copyright (c) 1992-2011 The FreeBSD Project."
> string (first line of typical dmesg, check for your particular
> OS version!) indicates when the system was booted. But
> note that the date format is not the common sortable
> kind of `date "+%d.%m.%Y"`.
>=20
> Another idea (as already mentioned) is to subtract `uptime`
> from current `date`. :-


Check the timestamp on /var/run/dmesg.boot  That is only written to when =
the system boots.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?03962865-7560-43F4-B8E6-7F8652A1B488>