#!/bin/bash
systemctl stop ntpd.service
ntpd -qg
ntpd -qg
ntpd -qg
ntpd -qg
systemctl start ntpd.service
hwclock -w
... and name file ntp.sh and make executable.
Edit /etc/ntp.conf and under '# Associate to public NTP pool servers; see http://www.pool.ntp.org/', replace the three lines of 'server 0.pool.ntp.org' with...
server 0.uk.pool.ntp.orgN.B. The 'uk' is for United Kingdom. Insert your own region.
server 1.uk.pool.ntp.org
server 2.uk pool.ntp.org
server 3.uk pool.ntp.org
Save, and as sudo, run ntp.sh script.
sudo ./ntp.shTo sync the clock every time your computer boots run...
sudo systemctl enable ntpdN.B. Alternately, replace 'systemctl start ntpd.service' in the top script with the above command.
No comments:
Post a Comment