rsync include-from问题

时间:2014-03-17 08:03:01

标签: unix rsync

我遇到了rsync --include-from命令的麻烦。我已经阅读了谷歌前三页中与我的问题匹配的提示,但我仍然无法让它工作。

这是我想要做的。我们有2台服务器,我想将数据从一台服务器同步到另一台服务器。但我只想发送应该传输的目录和文件。不需要所有其他目录/文件。

我创建了一个名为include_files的文件,其中包含以下数据:

+ test1/*
+ test1/tekstbestand.txt
- *

我的命令是:rsync -anv --include-from=/home/otsadmin/include_files otsadmin@nisbak:/home/otsadmin/tmp /home/otsadmin/

输出始终保持不变:

receiving incremental file list sent 56 bytes received 10 bytes 44.00 bytes/sec total size is 0 speedup is 0.00 (DRY RUN)

请帮助我理解我做错了什么。或者首先不可能。

1 个答案:

答案 0 :(得分:3)

我有这个问题很久了,你需要指定文件夹然后文件: -

+ test1
+ test1/tekstbestand.txt
- *

或者,如果你想在/ test1中包含所有内容,那么

+ test1
+ test1/**
- *
相关问题