歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> centos開機采用ntp同步時間

centos開機采用ntp同步時間

日期:2017/3/6 9:42:34   编辑:學習Linux

centos開機采用ntp同步時間


centos開機采用ntp同步時間


1、將系統時區改成上海時區

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

2、寫個腳本


ntp.cron

#!/bin/bash
/usr/sbin/ntpdate ntp.fudan.edu.cn | logger -t NTP

將該腳本 放到/etc/cron.daily 這個目錄中

即可實現每天自動同步時間

ntp.fudan.edu.cn 為復旦大學的網絡時間服務器 國內用戶建議使用

http://xxxxxx/Linuxjc/1134378.html TechArticle

Copyright © Linux教程網 All Rights Reserved