我正在运行以下 rsync 命令
rsync --times -v --recursive --compress --exclude "*.svn" --rsh=/usr/bin/ssh source/folder/ user@ip:httpdocs/
Run Code Online (Sandbox Code Playgroud)
运行时排除 *.svn 文件。我的问题是如何将要排除的文件类型列表传递给它。我们的开发副本中有很多不必要的隐藏文件(IDE 项目文件和 osx 特定文件)
我需要传入 5 或 6 个文件扩展名的列表,以便 rsync 忽略。
谢谢
使用--exclude-from选项,并指定一个文本文件,其中包含您想要避免的所有模式,例如:
rsync --times -v --recursive --compress --exclude-from /tmp/filelist.txt --rsh=/usr/bin/ssh source/folder/ user@ip:httpdocs/
Run Code Online (Sandbox Code Playgroud)