您的位置:首页 > 运维架构 > Shell

linux下添加需要开机执行的自定义shell脚本

2015-07-01 16:10 387 查看
下面来模拟,开机自动启动rsync服务

步骤如下:

1) shell> cd /etc/init.d

2) shell> vi rsyncServer

3) 内容如下:

#!/bin/bash

#

#chkconfig: 2345 70 30

#processname: rsyncServer

#description: myshell service

rsync --daemon --config=/etc/rsyncd.conf

4) 给rsyncServer文件添加可执行权限

shell> chmod +x rsyncServer

5) 然后将rsyncSever加入到开机启动项中

shell> chkconfig --add rsyncServer
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: