如何解决rsync 包含特定结构下的特定文件
以下测试结构:
src/
one/
one/
file.txt
two/
file.txt
two/
file.txt
我只想同步文件/one/two/file.txt。
我试过了,但它不起作用..
rsync -r --include='/one/two/file.txt' --exclude='*' src/ target/
解决方法
您使用 --include
有什么原因吗?如果它是单个文件,那么 rsync /one/two/file.txt /target/
会起作用。
看看这个答案: How to RSYNC a single file?
如果您尝试发送多个文件,那么您可以根据一种模式使用它: Using Rsync include and exclude options to include directory and file by pattern
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。