共计 770 个字符,预计需要花费 2 分钟才能阅读完成。
#!/bin/bash
######################
#int
CHECK=`rpm -qa rsync|wc -l`
HOSTIP=”192.168.1.0/24″
#rsync
PWD=”123456″
USER=”rsync_umbe”
PWD_PATH=”/etc/rsyncd/rsync.pwd”
RSYNC_USER=”rsync”
#loadsys functions
[-f /etc/init.d/functions] && . /etc/init.d/functions
RETVAL=0
#check rsync
if [“$CHECK” -eq 1];then
action “Rsync is installed” /bin/true
else
echo “error:rsync in not install”
echo “yum install -y rsync”
yum install rsync -y >>/tmp/rsync_install.log
echo “——————-” >>/tmp/rsync_install.log
action “rsync in installed” /bin/true
fi
#edit rsync.conf
if [! -f /etc/rsyncd.conf];then
cat >>/etc/rsyncd.conf<
chmod 600 /etc/rsyncd/rsync.pwd
fi
action “rsync configure successful” /bin/true
##START IP RSYNC
rsync –daemon
[`ps -ef|grep rsync|grep -v grep|wc -l` -eq 1] && {
action “rsync cofigure seccessful” /bin/true
exit $RETVAL
}