服务端(备份机器)rsync --daemon 守护进程
vim /data/auto_back/start_rsyncd.sh
#!/bin/sh
mobile='******'
IP='192.168.143.144'
pid_file='/etc/rsyncd/rsyncd.pid'
rsync_start_log='/data/log/start_rsyncd.log'
sms_url='http://test.sms.uu.cc:8081/SMS/sa/sms/send'
rsync_start='rsync --daemon --config=/etc/rsyncd/rsyncd.conf'
rsync_status=$(ps -ef | egrep "rsync --daemon.*rsyncd.conf" | grep -v 'grep')
if [ "${rsync_status}" == "" ]
then
rm -f ${pid_file}
${rsync_start}
if [ $? == 0 ]
then
w_time=`date "+%Y-%m-%d %H:%M:%S"`
content="${w_time} | gitlab备份机器(IP:${IP}) | rsyncd --daemon 重启成功"
else
w_time=`date "+%Y-%m-%d %H:%M:%S"`
content="${w_time} | gitlab备份机器(IP:${IP}) | rsyncd --daemon 重启失败"