服务器时间同步例子
时间:2010-07-21 来源:szxsztszk
例子1:
#more /root/time.sh
#!/bin/sh
/usr/bin/ntpdate asia.pool.ntp.org 实现linux和时间服务器的时间同步
/sbin/hwclock -w 实现bios和linux的时间同步
#crontab -l 01 6 * * * sh /root/time.sh 例子2: #crontab -l 01 6 * * * /usr/sbin/ntpdate time.windows.com >> /root/ntpdate.log 例子3: 01 6 * * * /usr/sbin/ntpdate asia.pool.ntp.org 这个时间服务器的ntp会计算网络传输中的误差.
/usr/bin/ntpdate asia.pool.ntp.org 实现linux和时间服务器的时间同步
/sbin/hwclock -w 实现bios和linux的时间同步
#crontab -l 01 6 * * * sh /root/time.sh 例子2: #crontab -l 01 6 * * * /usr/sbin/ntpdate time.windows.com >> /root/ntpdate.log 例子3: 01 6 * * * /usr/sbin/ntpdate asia.pool.ntp.org 这个时间服务器的ntp会计算网络传输中的误差.
相关阅读 更多 +