Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2015 15:11:42 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to update the hosts clock as part of cron daily?
Message-ID:  <55EEEC9E.4090005@FreeBSD.org>
In-Reply-To: <55EEE94E.4060906@gmail.com>
References:  <55EEE94E.4060906@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--sgPm0AhjMrm4LMBvtTdwb3C4V08oLhbTW
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 2015/09/08 14:57, Ernie Luzar wrote:

> My host motherboard clock is losing about 3 seconds a day.
> I have replaced the the motherboard battery but this did not help.
> So now I want to run "ntpd -q" or ntpdate once a day as part of
> cron:periodic:daily.
> I see 480.status-ntpd but no info on what it does or how to active if.
>=20
> What is the normal practice to accomplish this?

ntpd is a system daemon, and you enable it like any other daemon:

Add this to /etc/rc.conf:

ntpd_enable=3D"YES"
ntpd_sync_on_start=3D"YES"

Then, one time only, start ntpd:

# service ntpd start

With these settings in /etc/rc.conf, ntpd will be started automatically
on boot.

You can monitor how well ntpd is controlling your clock by running 'ntpq
-p' -- where the 'delay' 'offset' and 'jitter' values are measured in
milliseconds.  ntpd will keep most modern machines with a decent network
connection within about 30ms of its time sources (and frequently it will
manage within about 5ms) once it has got itself properly synched.

Don't bother trying to run ntpdate or similar out of cron.  It isn't
effective.  Just leave ntpd running.

	Matthew




--sgPm0AhjMrm4LMBvtTdwb3C4V08oLhbTW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQJ8BAEBCgBmBQJV7uykXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxOUYxNTRFQ0JGMTEyRTUwNTQ0RTNGMzAw
MDUxM0YxMEUwQTlFNEU3AAoJEABRPxDgqeTntYIP/A2K4S2FyzVehTRhV6if0Oay
lkR0yqQIShRv9hBfZtBJE9wtQZUzPt8uvJ5MQYzqrM+108g2eny92di2xtAFzb6m
AL3CEvm5nb8F22Q5qJmuvlz80HME62TYtBZDECRrb2tEDJXnCCUvEgR5bhTUrNu7
gl+ncwupB3nUt40WWderjcjwmKyOFYvRub5aq0twq8mtrCUiyEkueygs0p7Md81G
Su+wzmzRZ8bFUMmbZUV29wLioL1t7+13qSE2bjLwHQ3gAx/FW2/mS2KeeZiWqZDe
DgzjKlehftpCQ35QjDifoxI68peEzemTbm4hU/lR5BJJhyPc8ZaxynxZdm9RpihR
OhfDS/ly2vEDwPB5Vi/q0TuL/Wz6NZI4uzBq645M65G642WtyW7TzPWxYzX+9zCy
GEoHD3trFhuAS1clmYiWp5039kqauElDbYXzW6VFhtrsTVy/I+1jBgb0ce1D0BuK
7Or/UeFgO3mrqzLrZ9IVNNV03BnsaQNDpUy+xAXBiksFK3rJV9sptR2A/5O6+tj8
0XQ1h6hHuq65amKRey02ocoeCgPCB5EhktkCuv7wZlTKy3/AI8yBIk6AFNQeGbjM
KNul0BxKNa36Of2dQqT56vLoigrS3a+IDlr45kwBrNXx9wxCe19lzbxoLQxvfzth
DkQFQXx5rW/h7On59Ay1
=L7Hk
-----END PGP SIGNATURE-----

--sgPm0AhjMrm4LMBvtTdwb3C4V08oLhbTW--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55EEEC9E.4090005>