Linux同步标准时间rdate时间同步


首先安装 rdate和nptdate,然后使用以下命令:

rdate -s time.nist.gov

或:

rdate -s time-b.nist.gov

或:

rdate -s time-a.nist.gov

 或:

ntpdate -u ntp.sjtu.edu.cn

可以加入定时任务,实现自动更新:

vim /etc/crontb  加入以下内容

*/5 * * * * root ntpdate -u ntp.sjtu.edu.cn
*/5 * * * * root rdate -s time-b.nist.gov
*/5 * * * * root rdate -s time-a.nist.gov
*/5 * * * * root rdate -s time.nist.gov

重启定时任务:

sysctmctl restart crond