---
title: "linux 时间同步设置"
author: "carma2002"
date: "2011-12-23T11:06:19Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2011-12-23T11:06:19Z"
id: 1322409
url: "https://carma2002.iteye.com/blog/1322409"
---

1. 修改 /etc/sysconfig/clock文件内容为
ZONE="Asia/Shanghai"
UTC=false
ARC=false

2. 执行下面操作
rm -rf /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
rdate -s time-nw.nist.gov

如需频繁同步，添加定时任务
3.执行 crontab -e, 加入以下内容。每10分钟同步一次时间, 23:55同步一次
0-59/10 * * * * rdate -s time-nw.nist.gov
55 23 * * * rdate -s time-nw.nist.gov