我正在尝试使用 rsync 和 ssh 来比较两个 Linux 系统上的所有文件,方法是使用 --dry-run 选项,这样它就不会同步任何文件/文件夹。我究竟做错了什么?运行此命令时,我当前位于根目录中。
命令:
rsync --dry-run -v 'ssh -p 22' [email protected]:/
输出:
[root@localhost /]# rsync --dry-run -v 'ssh -p 22' [email protected]:/
The authenticity of host '192.168.86.128 (192.168.86.128)' can't be established.
RSA key fingerprint is 22:e5:15:2e:0b:69:5d:cd:63:84:83:61:b7:ce:19:56.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.86.128' (RSA) to the list of known hosts.
[email protected]'s password:
rsync: link_stat "/ssh -p 22" failed: No such file or directory (2)
sent 16 bytes received 12 bytes 1.70 bytes/sec
total size is 0 speedup is 0.00 (DRY RUN)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1039) [sender=3.0.6]
[root@localhost /]#
答案1
这在比较系统 A 和系统 B 时有效。
rsync --dry-run -r [email protected]:/ /
当比较系统 B 和系统 A 时,这是有效的:
rsync --dry-run -r [email protected]:/ /
答案2
梅尔德通过友好的界面递归地比较文件夹。