1、安装ntpdate(sudo apt-get install ntpdate)
2、同步时间:ntpdate 1.cn.pool.ntp.org
3、设置时区:cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
4、写进硬件时钟:hwclock -w
5、添加定时任务:
vi /etc/crontab
10 5 * * * root ntpdate 1.cn.pool.ntp.org;hwclock -w
1、安装ntpdate(sudo apt-get install ntpdate)
2、同步时间:ntpdate 1.cn.pool.ntp.org
3、设置时区:cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
4、写进硬件时钟:hwclock -w
5、添加定时任务:
vi /etc/crontab
10 5 * * * root ntpdate 1.cn.pool.ntp.org;hwclock -w