Sometimes it is necessary to ensure the system clock of all systems is synchronized. E.g. when running a virtual machine, depending on your virtualization technology and your settings your system clock may diverge. This can be achieved by updating the system clock using
Executing a command regularly can be easily done with
cron. Updating the system time is possible via
ntpd. So simply add a file to
/etc/cron.daily and add the command for updating system clock there. So once a day your system time will be updated. Of course you can do that more often or maybe once a month only. But I think once a day is quite good enough for a huge number of scenarios.
ntpd -g -q
-g in case there is a difference
-q for exiting ntpd right after setting the system clock the first time