我试图使用 rsync 仅从给定目录复制 .c 文件。因此我尝试了这个命令:
rsync -nrv --include="*.c" --exclude="*" test/ temp/
输出:
sending incremental file list
test1.c
test2.c
sent 63 bytes received 18 bytes 162.00 bytes/sec
我要复制的数据找到了,但是当我检查'temp'时,它是空的。 我也尝试让rsync创建目录,输出如下:
sending incremental file list
created directory temp
./
test1.c
test2.c
sent 66 bytes received 21 bytes 174.00 bytes/sec
但是当我检查目录“temp”时,它不存在。 我究竟做错了什么?
最佳答案
你给了-n
,意思是“dry run”!
删除-n
您至少应该查看手册页以了解您使用的选项,以了解其含义:
-n, --dry-run perform a trial run with no changes made
关于linux - rsync 不复制我的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23383774/