rsync同步排除文件

最近遇到一個項目,需要對文件進行同步,但是需要排除一個文件

在192.168.6.251上運行

/usr/bin/rsync -vzrtopg --progress --password-file=/etc/rsyncd.pw /usr/local/tomcat/webapps/* --exclude "ad/WEB-INF/classes/configBean.xml" [email protected]::backup

這裏指定的是排除一個文件,爲文件相對目錄的

ad/WEB-INF/classes/configBean.xml

如果指定對個文件,可以直接添加多個--exclude

如果是指定目錄,就比如這樣:--exclude "ad/WEB-INF/classes/"

參考rsync 192.168.6.250服務器配置文件

###################################

uid = root
gid = root
use chroot = no
max connections = 4
stirict modes = yes
port = 873
[backup]
path = /www/abc.com/
comment = This is a test
ignore errors
read only = false
list = no
hosts allow = 192.168.6.251
hosts deny = 0.0.0.0/0
auth users = bakweb
secrets file =/etc/rsyncd.pw
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
###################################
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章