rsync+crontab每分钟同步文件

   日期:2020-10-30     浏览:92    评论:0    
核心提示:环境:192.168.172.131服务端192.168.172.133客户端服务端:1 yum -y install rsync2 mkdir /root/abccd /root/abctouch aaa3 vim /etc/rsyncd.confuid = nobodygid = nobodyuse chroot = yesaddress = 192.168.172.131port 873log file = /var/log/rsyncd.logpid file =

环境:
192.168.172.131服务端
192.168.172.133客户端

服务端:

1 yum -y install rsync
2 mkdir /root/abc
cd /root/abc
touch aaa
3 vim /etc/rsyncd.conf

uid = nobody
gid = nobody
use chroot = yes
address = 192.168.172.131
port 873
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
hosts allow = 192.168.172.0/24
[wwwroot]
path = /root/abc
comment = Document Root of www.51xit.top
read only =no
dont comperss = *.gz *.bz2 *.tgz *.zip *.rar *.z
auth users =backuper
secrets file = /etc/rsyncd_users.db

4 cat /etc/rsyncd_users.db
backuper:pwd123
chmod 600 /etc/rsyncd_users.db
systemctl stop firewalld
5 rsync --daemon
netstat -anpt |grep rsync
tcp 0 0 192.168.172.131:873 0.0.0.0:* LISTEN 12173/rsync

客户端

yum -y install rsync
systemctl stop firewalld
mkdir /root/abc
chmod 777 /root/abc
vi /etc/server.pass

chmod 600 /etc/server.pass
rsync -az --password-file=/etc/server.pass backuper@192.168.172.131::wwwroot /root/abc
cd abc/
ll

crontab -e

到这里就结束了

 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服