Rsync Startup Script

Source: Internet
Author: User

Rsync STARTUP script 01 #! /Bin/bash www.2cto.com 02 #03 # rsyncd This shell script takes care of starting and stopping04 # standalone rsync.05 #06 # chkconfig:-99 5007 # description: rsync is a file transport daemon08 # processname: rsync09 # config:/etc/rsyncd. conf10 11 # Source function library12./etc/rc. d/init. d/functions13 14 RETVAL = 015 rsync = "/usr/local/bin/rsync" 16 prog = "rsync" 17 CFILE = "/etc/rsyncd. conf "18 19 start () {20 # Star T daemons.21 [-x $ rsync] | \ 22 {echo "FATAL: No such programme"; exit 4 ;} 23 [-f $ CFILE] | \ 24 {echo "FATAL: config file does not exist"; exit 6;} 25 echo-n $ "Starting $ prog: "26 daemon $ rsync -- daemon -- config = $ CFILE27 RETVAL =$? 28 [$ RETVAL-eq 0] & touch/var/lock/subsys/$ prog29 echo30 return $ RETVAL31} 32 33 stop () {34 # Stop daemons.35 echo-n $ "Stopping $ prog:" 36 killproc $ prog-QUIT37 RETVAL =$? 38 echo39 [$ RETVAL-eq 0] & rm-f/var/lock/subsys/$ prog40 return $ RETVAL41} 42 43 # call the function we defined44case "$1" in45 start) 46 start47; 48 stop) 49 stop50; 51 restart | reload) 52 stop53 start54 RETVAL =$? 55; 56 status) 57 status $ prog58 RETVAL =$? 59; 60 *) 61 echo $ "Usage: $0 {start | stop | restart | reload | status}" 62 exit 263esac64 65 exit $ RETVAL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.