Sync Time with Public NTP Servers Using ntpd command – Linux
In this article we are going to show how to update server time to sync internet time with NTP. Sync time Or Server time with NTP sync is important which creates a lot problem if any time mismatch. Examples Like, We will get wrong time in server logs, If server is part cluster then cluster services will fail to serve the services due to time mismatch.
Check ntpd service status and stop followed by below commands
Sync Time with Public NTP Servers Using ntpd command
[root@linux ~]# /etc/init.d/ntpd stop ntpd is stopped [root@linux ~]#
update the time
[root@linux ~]# ntpd -gq ntpd: time set -106.807803s [root@linux ~]#
- -q –-> requests the daemon to quit after updating the date from the ntp server.
- -g –-> update irrespective of the time offset
Now restart the ntpd service
[root@linux ~]# /etc/init.d/ntpd restart Shutting down ntpd: [ OK ] Starting ntpd: [ OK ] [root@linux ~]#
Check the time on the server and verify with internet time.
[root@linux ~]# date
Successfully updated. That’s it.
Thanks for your wonderful Support and Encouragement
Stay Connected With Us. Learn More and Earn More