ubuntu 12.04 使用NTP服务器校正系统时间【备忘】

来源:互联网 发布:python输入输出函数 编辑:程序博客网 时间:2024/05/16 05:14


不解释,如下:

ubuntu@00-01:~$ sudo ntpdate clock.stdtime.gov.tw
10 Oct 14:55:30 ntpdate[10805]: step time server 220.130.158.72 offset 58537.743430 sec
ubuntu@00-01:~$ date
2012年 10月 10日 星期三 14:55:45 CST


以下内容参考网络:
2.将校准后的时间写入BIOS clock
ubuntu@00-01:~$ sudo hwclock -w
3.将较时加到计划任务里,让系统每天跟 ntp.ubuntu.com同步一次。
ubuntu@00-01:~$ sudo -s     【user】(缺省表示root用户)
root@00-01:~# crontab -e
no crontab for root - using an empty one

Select an editor.  To change later, run 'select-editor'.
  1. /bin/ed
  2. /bin/nano        <---- easiest
  3. /usr/bin/vim.basic
  4. /usr/bin/vim.tiny
Choose 1-4 [2]: 2


9 0 * * * /usr/sbin/ntpdate ntp.ubuntu.com;/sbin/hwclock -w
每天9点同步一次时间,保存推出
crontab: installing new crontab
0 0
原创粉丝点击