Article

Set date/time via NTP on linux host

I have a virtual machine that needs the clock updated from time to time.  The ntp client is already installed so this is all it takes to sync the time:

ntpdate ntp1.[domain].com

I need to setup a cron job to do so for me. If I wanted hourly updates, I'd do

 crontab -e

and then add the command:

@hourly /etc/network/if-up.d/ntpdate ntp1.[domain].com

Hourly is excessive, my clock isn't that bad.

Comments Closed.