---
title: "USE LINUX下设置开机时间同步"
author: "hanjiangit"
date: "2010-02-01T16:13:03Z"
tags: []
categories: ["操作系统"]
slug: "use-linux"
draft: false
lastmod: "2010-02-01T16:13:03Z"
id: 585125
url: "https://wallboy.iteye.com/blog/585125"
---

设置步骤如下：

STEP１：编辑脚本

        在/etc/init.d/下新建zhjdate脚本，添加如下内容：

```
    #!/bin/ksh
    # chkconfig: 345 63 37
    #chkconfig:345 63 37 (数字345是指在运行级别为3、4、5时启动；数字63是指启动的优先级；数字 37是指停止的优先级）
    /usr/sbin/ntpdate 210.72.145.44 >> /var/log/ntpdate.log
```

 

STEP 2：修改脚本属性

#chmod 755zhjdate

STEP 3：配置脚本自启动

#chkconfig -level 345 zhjdate on