我使用rsync将一些文件从一个共享复制到另一个共享。
递归地,我需要:
.svn/目录如果我用这个:
rsync -zavC --delete --include='*.php' --include='*.js' --exclude="*" \
/origiin /destination那么rsync不是递归的,因为exclude="*"排除了所有文件,也排除了文件夹。
如果我添加--include="*/",那么.svn/目录就会被删除(它也会被包括在内)
名为-a:
Linuxtux3.9.2-1-ARCH #1 SMP抢占5月11日20:31:08 CEST 2013 x86_64 GNU/Linux
rsync版本:
rsync 3.0.9-6提前感谢
发布于 2013-05-17 23:20:06
好吧,经过几次尝试,我整理了一下:
rsync -vaiz --delete --exclude=.svn/ --include='*.php' --include='*.js' \
--include='*/' --exclude='*' --prune-empty-dirs \
--filter "protect .svn/" /origin /destination如果您不介意同步空脏,只需:
rsync -vaiz --delete --exclude=.svn/ --include='*.php' --include='*.js' \
--include='*/' --exclude='*' /origin /destination关键是--exclude=.svn/在--include's之前
https://serverfault.com/questions/508783
复制相似问题