利用shell函数开发rsync服务启动脚本,之前的不够专业#!/bin/bash
#chkconfig: 2345 20 80
分类:
系统相关 时间:
2018-02-05 10:36:52
阅读次数:
282
[root@m01 20171207]# cat ryn_srv.sh #!/bin/bash rsn_file="/usr/bin/rsync" # 判断启动的进程数 [ -e /etc/init.d/functions ] && source /etc/init.d/functions || e... ...
分类:
其他好文 时间:
2017-12-07 17:14:18
阅读次数:
199
实验环境:OS:CentOS6.8[root@sky9896/]#chkconfig--addrsyncdrsyncd服务不支持chkconfig[root@sky9896/]#cat/etc/init.d/rsyncd#/bin/bash#chkconfig:23452080#添加该条即解决服务支持chkconfig[root@sky9896/]#chkconfig--addrsyncd[root@sky9896/]#chkconfig--listrsyncdrs..
分类:
其他好文 时间:
2017-07-20 22:21:13
阅读次数:
271
需求:写一个rsync服务启动脚本思路:1、首先对脚本参数个数进行判断如果传参个数不等于1,则echo"Usage:$0{start|restart|stop}"2、定义函数service,通过case进行对脚本传参值的流程控制判断3、启动服务采用命令rsync--daemon4、停止服务采用kill-9进程和删除rsync的PID文件[..
分类:
其他好文 时间:
2017-05-10 11:24:22
阅读次数:
157
#!/bin/sh#filename:rsync_start.sh#date:2015-12-14#作者:linuxzkq#version:v1.0#chkconfig:23452365#description:Startrsyncandstoprsyncscripts.prog="rsync"pidfile=/var/run/rsyncd.pidexec=/usr/bin/rsync./etc/init.d/functions[-f/usr/bin/rsync]||echo"pleaseinstall..
分类:
其他好文 时间:
2015-12-26 23:42:55
阅读次数:
185
#!/bin/sh#filename:rsync_start.sh#date:2015-12-14#作者:linuxzkq#version:v1.0#chkconfig:23452365#description:Startrsyncandstoprsyncscripts.prog="rsync"pidfile=/var/run/rsyncd.pidexec=/usr/bin/rsync./etc/init.d/functions[-f/usr/bin/rsync]||echo"pleaseinstall..
分类:
其他好文 时间:
2015-12-16 09:42:04
阅读次数:
222