Linux システム A のルートディレクトリと Linux システム B のルートディレクトリを再帰的に比較します。

Linux システム A のルートディレクトリと Linux システム B のルートディレクトリを再帰的に比較します。

どのファイル/フォルダも同期しないように、--dry-runオプションを使用してrsyncとsshを使用して両方のLinuxシステム上のすべてのファイルを比較しようとしています。私は何が間違っていましたか?このコマンドを実行すると、現在のルートディレクトリにあります。

注文する:

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]:/ /

おすすめ記事