NTP Cron Job

If necessary, install ntpdate and test it as follows:

sudo apt-get install ntp ntpdate
sudo ntpdate ca.pool.ntp.org

Then create a daily cron script…

sudo vi /etc/cron.daily/ntpdate.sh

… with the following contents:

#!/bin/bash
ntpdate ca.pool.ntp.org > /dev/null
exit 0

Finally, set the execute bit for the new script and test it!

sudo chmod +x /etc/cron.daily/ntpdate.sh
sudo /etc/cron.daily/ntpdate.sh

Leave a Reply

Your email address will not be published. Required fields are marked *