试图rsync某个扩展名(*.sh)的文件,但下面的bash脚本仍然传输所有文件,为什么?
from=/home/xxx rsync -zvr --include="*.sh" $from/* root@$host:/home/tmp/
最佳答案
你需要添加一个 --exclude all 并且它必须在 --include 之后
rsync -zvr --include="*.sh" --exclude="*" $from/* root@$host:/home/tmp/
关于bash - rsync --include 选项不排除其他文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14655834/