rsync启动脚本

来源:互联网 发布:设定清奇的小说知乎 编辑:程序博客网 时间:2024/05/29 18:25

rsync启动脚本

#!/bin/bash#Author: seventeenWen#Date : 2017/08/05#chkconfig:  234 66 88#description : this scripts is rsync chkconfig config [ -f /etc/init.d/functions ]&& .  /etc/init.d/functionsRETAVL=0prog="rsync"start() {        if [ ! -f /var/run/rsyncd.pid ];then                 /usr/bin/rsync --daemon --config=/etc/rsyncd.conf        fi        RETAVL=$?        if [ $RETAVL -eq 0 ];then                action  "starting  $prog ......   "  /bin/true        else                action  "starting  $prog ......   "  /bin/false        fi        return $RETAVL}stop() {        killproc  /usr/sbin/rsync        RETAVL=$0        sleep 1        if [ $RETAVL -eq 0 ];then                action  "stoping   $prog  ......    "  /bin/true        else                action  "stoping   $prog  ......    "  /bin/false        fi}restart() {        $0 stop        $0 start}case "$1" instart)        start;;stop)        stop;;restart|reload)        restart;;*)        echo "use  (strat|stop|restart)"        exit 1esac
原创粉丝点击