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
步骤如下:
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
相关文章推荐
- shell变量详解
- shell脚本(二)
- shell变量说明
- BASH 进阶(转载防丢)
- shell查找文件并删除
- “UEFI虚拟机”以及“EFI SHELL”介绍
- shell脚本echo的换行操作
- shell 监控文件更新并同步到其它机器
- Shell脚本之数组
- bash shell学习-shell script基础 (笔记)
- Shell脚本实现监视指定进程的运行状态
- shell-----sed命令详解
- shell-----sed命令详解
- 更改Linux用户的登录shell环境
- linux shell script中的exit后面接的退出码有哪些?
- Linux shell scripts中条件判断语句中的常用参数
- Shell脚本之监视指定进程的运行状态
- Linux使用Shell脚本实现ftp的自动上传下载
- Shell脚本--刘晓涛
- PHP+shell实现多线程的方法