From owner-freebsd-questions@FreeBSD.ORG Wed Jan 26 17:00:54 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8143E1065673 for ; Wed, 26 Jan 2011 17:00:54 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5D78FC19 for ; Wed, 26 Jan 2011 17:00:53 +0000 (UTC) Received: by fxm16 with SMTP id 16so1241640fxm.13 for ; Wed, 26 Jan 2011 09:00:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=gG+MmYZNNr/9zvSJ2IS1YEFO0VJN82E5CaFyDBEk6Mk=; b=scP8Et8BfvbS2LjDQap2OdM/azCrTojD7qJpJfuRgTjTCAIwFE1J/Bs/hKWvqgH9fl MKIxlaNMkkD+EIepSt4+NSe9yMe52jHqfqFNqzv94EqrnslKsSqJti2cKwtIIlKXMqHs 7PqMCogZAF2UOWn6mRySESWcWrIw7KaiBDxb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=CRAEeP2a7mDfWbkFxV6LC2i9xgRLzioSAlWJbguco3A6E07GYIg4DHiGH5Q6gurqJS ngp/reJ5uNPk2JtqueTI21xdZKuoHxnUvbX8YmKqnJtNGdXOV6nuRspchysv9RFvzPr8 4jhJL4sXAMbCCJ+ffJnPsTcqaV0r+lyPzaqpw= Received: by 10.223.81.76 with SMTP id w12mr7517426fak.26.1296061132721; Wed, 26 Jan 2011 08:58:52 -0800 (PST) Received: from Melon.malikania.fr (65.21.102-84.rev.gaoland.net [84.102.21.65]) by mx.google.com with ESMTPS id a17sm7604444bku.23.2011.01.26.08.58.48 (version=SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 08:58:50 -0800 (PST) Message-ID: <4D4052C3.9090106@gmail.com> Date: Wed, 26 Jan 2011 17:58:43 +0100 From: David Demelier User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20110125 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4D2F606D.6090407@gmail.com> <20110113232321.5857ad0f@gumby.homeunix.com> <20110114153212.GA21418@libertas.local.camdensoftware.com> <87sjwv2uj7.fsf@oak.localnet> In-Reply-To: <87sjwv2uj7.fsf@oak.localnet> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Date of a FreeBSD installation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:00:54 -0000 On 14/01/2011 19:46, Carl Johnson wrote: > Chip Camden writes: > >> Quoth Carl Chave on Friday, 14 January 2011: >>>> I'd suggest looking at the Btimes of top level directories >>>> >>>> stat -f "%SB %N" /* >>> >>> Or how about just / as this ~15 minutes earlier than most of the >>> remaining top level directories >>> >>> >>> sodserve# stat -f "%SB %N" /* >>> Jan 9 04:54:21 2011 /COPYRIGHT >>> Jan 9 04:54:21 2011 /bin >>> Jan 9 04:54:21 2011 /boot >>> Dec 31 18:59:59 1969 /dev >>> Jan 9 04:54:21 2011 /etc >>> Jan 9 04:54:21 2011 /lib >>> Jan 9 04:54:21 2011 /libexec >>> Jan 9 04:54:21 2011 /media >>> Jan 9 04:54:21 2011 /mnt >>> Jan 9 04:54:21 2011 /proc >>> Jan 9 04:54:21 2011 /rescue >>> Jan 9 04:54:21 2011 /root >>> Jan 9 04:54:21 2011 /sbin >>> Jan 9 04:54:21 2011 /sys >>> Jan 9 04:48:39 2011 /tmp >>> Jan 9 04:48:45 2011 /usr >>> Jan 9 04:49:39 2011 /var >>> >>> sodserve# stat -f "%SB %N" / >>> Jan 9 04:39:59 2011 / >> >> For me, that gets the Nov 21 2009 date, which is earlier than my >> install date. >> >> So far, /etc/hostid and the /home symlink seem to be the winners. > > On my system /etc/hostid is several days later than my actual install > date, so that isn't always reliable. You might want to create a file > with the timestamp you want. The most likely time appears to me to be > the 'Created' time in /etc/rc.conf, as someone suggested earlier. The > following code will extract that and create a file with that timestamp. > I have checked it on my system, but use at your own risk. > > file=/etc/install_date > date=$(grep '^# Created: ' /etc/rc.conf | cut -c 12-80) > tdate=$(date -j -f "%a %b %d %H:%M:%S %Y" "$date" "+%Y%m%d%H%M.%S") > echo $date> $file > touch -t $tdate $file > chmod -w $file > chflags schange $file > I finally agreed for /home symlink. I've made a mistake. To be sure the link and not the directory /usr/home is touched the best to do is : # chflags -h uchg /home -h means "not following links" -- David Demelier