1、NTP 设置为中国上海时间并同步[[email protected] ~]yum install -y ntp
[[email protected] ~]rm -rf /etc/localtime
[[email protected] ~]ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[[email protected] ~]ntpdate cn.pool.ntp.org
[[email protected] ~]date
2、用crond添加计划任务:
在最后添加 “3 3 * * * /usr/sbin/ntpdate 0.asia.pool.ntp.org > /dev/null 2>&1 ”,最后重启服务。
3 3 * * * /usr/sbin/ntpdate cn.pool.ntp.org > /dev/null 2>&1
。。。[[email protected] ~]# service crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
原文:http://fzhddn.blog.51cto.com/12650899/1917110