Linux 添加开机自动执行脚本

老牛浏览 380评论 0发表于

新建一个文件 synctime,内容如下:

bash
#!/bin/sh
#
# mysqld    This shell script takes care of starting and stopping
#       the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description:  MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

ntpdate time.nist.gov

添加到开机启动:

bash
chkconfig synctime on
点赞
收藏
暂无评论,快来发表评论吧~
私信
老牛@ilaoniu
老牛,俗称哞哞。单纯的九零后理工小青年。喜欢折腾,爱玩,爱音乐,爱游戏,爱电影,爱旅游...
最后活跃于