$ which ntpdate
/sbin/ntpdate
$ crontab -e // 每隔一小时同步更新一次时间
0 */1 * * * /sbin/ntpdate pool.ntp.org >/dev/null 2>&1
阿里云服务器
而阿里云服务器内置了时间同步服务,参考
https://help.aliyun.com/zh/ecs/user-guide/alibaba-cloud-ntp-server
$ which ntpdate
/sbin/ntpdate
$ crontab -e // 每隔一小时同步更新一次时间
0 */1 * * * /sbin/ntpdate pool.ntp.org >/dev/null 2>&1
而阿里云服务器内置了时间同步服务,参考
https://help.aliyun.com/zh/ecs/user-guide/alibaba-cloud-ntp-server