rsync排除不工作

我有以下rsync排除,我试图运行:

rsync -av --exclude 'home/dir/public_html/config.text' root@remote. server.com:/home/dir/public_html/ /home/dir/public_html 

我搜查了文件,我相信我做得对,但我显然做错了。

好的,我明白了。 我在考虑排除错误。 排除匹配模式“config.txt”而不是path。 所以当我做了以下更改它工作正常:

rsync -av –exclude“config.text” root @ remote。 server.com:/home/dir/public_html/ / home / dir / public_html

我希望这可以帮助别人