Find a perfect RYSNC on the Internet script: http://linux5588.blog.51cto.com/65280/779000
Rsync Source code:
[email protected] d4]# cat Rsync_start_restart.sh#!/bin/shif ["$" = = "Restart"];then [-f/var/run/rsyncd.pid] &A mp;& kill ' Cat/var/run/rsyncd.pid ' /bin/rm-f/var/run/rsyncd.pid && rsync--daemonfi
First execution: [[email protected] d4]# sh-x rsync_start_restart.sh restart+ ' [' Restart = Restart '] ' + ' ['-f/var/run/rsyncd.pid '] ' +/bin/rm-f/var/run/rsyncd.pid+ rsync--daemon Second execution [[email protected] d4]# sh-x rsync_start_restart.sh restart+ ' [' Restart = = Restart '] ' + ' ['-f/var/run/rsyncd.pid '] ' + + cat/var/run/rsyncd.pid+ kill 3455+/bin/rm-f/VAR/RUN/RSYNCD.P id+ rsync--daemon
Question point: I do not know why the second execution obviously saw the rsync--daemon execution, but rsync is not up. Is it a logical mistake to think about it for a long time?
rsync start Stop Script