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 为复旦大学的网络时间服务器 国内用户建议使用
作者“开源运维研究室”