使用Rsync同步的時候往往會要求對某個檔案夾或者檔案進行忽略,用戶端可以使用--exclude參數來實作對,目錄或者檔案的忽略
rsync -rltvz --port=873 --exclude ".svn" --exclude "Log" --progress --delete [email protected]::web /cygdrive/D/web/
另外排除的檔案及目錄較多的情況還可以寫到一個檔案裡:
rsync -rltvz --port=873 --exclude-from=exclude.txt --progress --delete [email protected]::web /cygdrive/D/web/
exclude.txt 檔案格式如下:
.svn
Log
abc.txt
本文轉自 頂風走千裡 51CTO部落格,原文連結:http://blog.51cto.com/13505030/2047570