rsync 3.1.1源代码编译安装配置
生活随笔
收集整理的這篇文章主要介紹了
rsync 3.1.1源代码编译安装配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
http://rsync.samba.org/rsync-3.1.1.tar.gz---0.卸載rpm# yum remove rsync-----1.安裝:tar -zxvf rsync-3.1.1.tar.gzcd rsync-3.1.1./configure --prefix=/usr/local/rsync --disable-ipv6makemake installln -s /usr/local/rsync/bin/rsync /usr/local/bin/rsync----2.server端配置# vi /usr/local/rsync/rsyncd.confpid file = /var/run/rsyncd.pid
port = 873
pid = root
gid = root
use chroot = no
max connections = 200
timeout 600
lock file = /var/run/rsyncd.lock
log file = /var/run/rsyncd.log
secrets file = /usr/local/rsync/rsyncd.secrets
motd file = /etc/rsyncd.motd[test]
path = /test/
ignore errors
read only = true
list = false
hosts allow = *
#hosts deny = 0.0.0.0/32
auth users root #該用戶系統中存在且對后面指定的備份文件夾擁有權限
comment = ocpyang test #vi /usr/local/rsync/rsyncd.motd++++++++++++++++++++++++++++++++++++
Wlecome to ocpyang rsync services
++++++++++++++++++++++++++++++++++++--指定rsync訪問的password,password不須要和系統賬號password同樣# vi /usr/local/rsync/rsyncd.secrets
root:snow01ln -s /usr/local/rsync/rsyncd.conf /etc/rsyncd.conf
ln -s /usr/local/rsync/rsyncd.motd /etc/rsyncd.motd
ln -s /usr/local/rsync/rsyncd.secrets /etc/rsyncd.secretschmod 600 /usr/local/rsync/rsyncd.secretschown root:root /usr/local/rsync/rsyncd.secrets啟動rsync# /usr/bin/rsync --daemon --config=/etc/rsyncd.conf# echo "/usr/bin/rsync --daemon --config=/etc/rsyncd.conf" >> /etc/rc.d/rc.local # cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.touch /var/lock/subsys/local
/usr/bin/rsync --daemon# netstat -lntp | grep 873
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 10689/rsync
tcp 0 0 :::873 :::* LISTEN 10689/rsync --新建測試文件
#dd if=/dev/zero of=/test/t01.file bs=1M count=50#pkill rsync----3.client服務器配置(1).新建clientpassword文件(client不帶username)#vi /etc/rsyncd.secrets
snow01#chmod 600 /etc/rsyncd.secretsrsync -vzrtopg --progress --delete root@192.168.5.189::test /ocpyang/ rsync -vzrtopg --progress --delete root@192.168.5.189::test /ocpyang/ --password-file=/etc/rsyncd.pwd(3).新建同步腳本# vi /rsync.sh
#!/bin/bashrsync -vzrtopg --progress --delete root@192.168.5.189::test /testbak/ rsync -vzrtopg --progress --delete root@192.168.5.189::test /testbak/ --password-file=/etc/rsyncd.pwd(4).手動同步文件#cd /
#./rsync.sh(5).自己主動同步:每隔五分鐘同步一次
# crontab -e
0,5 * * * * /rsync.sh
轉載于:https://www.cnblogs.com/lytwajue/p/7130702.html
總結
以上是生活随笔為你收集整理的rsync 3.1.1源代码编译安装配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 动态代理Java实现
- 下一篇: vmware虚拟机克隆CentOS7 出