linux - rsync 不复制我的文件

标签 linux bash rsync

我试图使用 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/

相关文章:

c# - 当服务器关闭 keep-alive http 连接时检测或避免客户端 CommunicationException

python - 恢复已删除但正在运行 python 脚本

bash - seq 同时使用逗号和点作为小数分隔符

python - 如何部署高度迭代的更新

centos - 源 HFS+ objective-c entos 上的 rsync 3.0.9

linux - 在 BASH 中通过 Char 循环替换 Char

bash - 如何修改自定义挂载助手创建的/etc/mtab 条目,以便使用自定义 `umount`?

linux - 通过 cron 使用 bash 下载文件

c - 向 Rsync 中的选项添加参数

linux - Echo 命令行问题