#!/bin/bash /bin/mkdir -p /home/rsync/{log,pid,run} echo "linuxtest:linuxtest.org" >/home/rsync/rsync.pass chmod 600 /home/rsync/rsync.pass mkdir -p /data/web if [ -f /etc/rsyncd.conf ] then cp /etc/rsyncd.conf /etc/rsyncd.conf.back rm -rf /etc/rsyncd.conf rm -rf /home/rsync/pid/rsyncd.pid else exit 1 >/dev/null 2>&1 fi cat >> /etc/rsyncd.conf << EOF uid = root gid = root port=873 use chroot = no read only = no list = no max connections = 0 timeout = 600 log file = /home/rsync/log/rsyncd.log pidfile = /home/rsync/pid/rsyncd.pid lock file = /home/rsync/run/rsync.lock [web] path = /data/web comment = rsync ignore errors auth users = linuxtest secrets file = /home/rsync/rsync.pass hosts allow = * EOF rsync --daemon Rsync_Process=`ps -ef | grep rsync | grep -v grep|wc -l` if [ $Rsync_Process -eq "1" ] then echo "The rsync is running..." else echo "This rsync is not running." fi
一键安装rsync
原创taokey_linux 博主文章分类:linux Basics ©著作权
©著作权归作者所有:来自51CTO博客作者taokey_linux的原创作品,谢绝转载,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章