rsync exclude include二级目录或子级目录

之前的写法,d目录下面的文件不同步,网上的大部分例子都是同步的a/ b/ c/这种一级目录,二级目录的例子没有,

rsync -auHzSv  --ignore-errors --partial --password-file=/etc/rsync.pas --include "a/" --include "b/"  --include "c/d/" --include "header_image/"  --exclude "/*"       

修改后的写法,先include c / 再include c/d/,然后excludec下面的所有文件就好了

rsync -auHzSv  --ignore-errors --partial --password-file=/etc/rsync.pas --include "a/" --include "b/" --include "c/" --include "c/d/" --include "header_image/"  --exclude "/*"  --exclude "c/*"     

你可能感兴趣的:(Linux运维)