部分软件需要时间同步才能正常运行,然而有些机器就是时间走的不正常。 解决方法: ```shell yum -y install ntp #安装ntp工具 ``` ```shell rm -rf /etc/localtime #设置时区 ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime ``` ```shell /usr/sbin/ntpdate -u cn.pool.ntp.org #校准时间 ``` ```shell hwclock -w #写入时间 ``` 查看当前时间: ```shell hwclock -r ``` ```shell date ``` 设置自动时间同步: /etc/rc.d/rc.local 添加: ```shell /usr/sbin/ntpdate -u cn.pool.ntp.org> /dev/null 2>&1; /sbin/hwclock -w ``` crontab -e 添加: ```shell 00 10 * * * /usr/sbin/ntpdate -u cn.pool.ntp.org > /dev/null 2>&1; /sbin/hwclock -w ``` treesky 2023-01-26 上一篇: Linux测试MTU数值并设置 下一篇: TinyProxy 解决国内机器连接 Github问题 评论已关闭
评论已关闭