centos采用ntp同步时间

一、将系统时区改为上海时区bash

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime服务器

二、写个脚本网络


ntp.cronide

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

 

将该脚本 放到/etc/cron.daily 这个目录中it

便可实现天天自动同步时间class

ntp.fudan.edu.cn  为复旦大学的网络时间服务器 国内用户建议使用date

相关文章
相关标签/搜索