ターゲットファイルがあってもrsyncが機能しない

ターゲットファイルがあってもrsyncが機能しない

/export/home/remoteuser/stopforce.shRemotehost7からlocalhostディレクトリにファイルをインポートしたいと思います/tmp

ファイルがリモートホストに存在することを確認するには、次のコマンドを実行します。

[localuser@localhost ~]$ ssh remoteuser@remotehost7 ' ls -ltr /export/home/remoteuser/stopforce.sh'

This system is for the use by authorized users only. All data contained
on all systems is owned by the company and may be monitored, intercepted,
recorded, read, copied, or captured in any manner and disclosed in any
manner, by authorized company personnel. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy. Unauthorized or improper
use of this system may result in administrative, disciplinary action, civil
and criminal penalties. Use of this system by any user, authorized or
unauthorized, constitutes express consent to this monitoring, interception,
recording, reading, copying, or capturing and disclosure.

IF YOU DO NOT CONSENT, LOG OFF NOW.

##################################################################
# *** This Server is using Centrify                          *** #
# *** Remember to use your Active Directory account          *** #
# ***    password when logging in                            *** #
##################################################################

lrwxrwxrwx   1 remoteuser     oinstall      65 Aug 30  2015 /export/home/remoteuser/stopforce.sh -> /u/marsh/external_products/apache-james-3.0/bin/stopforce.sh

上記から、ファイルがソフトリンクであるにもかかわらず、リモートで存在することを確認できます。

今実際のファイルをインポートしようとしてrsyncエラーが発生します。

[localuser@localhost ~]$ /bin/rsync --delay-updates -F --compress --copy-links --archive remoteuser@remotehost7:/export/home/remoteuser/stopforce.sh /tmp/


This system is for the use by authorized users only. All data contained
on all systems is owned by the company and may be monitored, intercepted,
recorded, read, copied, or captured in any manner and disclosed in any
manner, by authorized company personnel. Users (authorized or unauthorized)
have no explicit or implicit expectation of privacy. Unauthorized or improper
use of this system may result in administrative, disciplinary action, civil
and criminal penalties. Use of this system by any user, authorized or
unauthorized, constitutes express consent to this monitoring, interception,
recording, reading, copying, or capturing and disclosure.

IF YOU DO NOT CONSENT, LOG OFF NOW.

##################################################################
# *** This Server is using Centrify                          *** #
# *** Remember to use your Active Directory account          *** #
# ***    password when logging in                            *** #
##################################################################

rsync: [sender] link_stat "/export/home/remoteuser/stopforce.sh" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1651) [Receiver=3.1.2]
rsync: [Receiver] write error: Broken pipe (32)

localhostはLinux、remotehost7はSolarisです。

このエラーが発生する理由と問題の解決策を提案してもよろしいですか?

ベストアンサー1

このオプションを使用しています--copy-links。これはテキストとして記録されます。

シンボリックリンクが見つかると、シンボリックリンクではなく、指すエントリ(参照オブジェクト)がコピーされます。 [...]

シンボリックリンクが既存のファイルを指していない場合、この--copy-linksオプションはrsyncファイルが見つからないというメッセージを表示します。の--copy-links場合いいえ使用すると、シンボリックリンク自体がコピーされます。

この問題に対する解決策は、達成しようとしている目標によって異なります。シンボリックリンクで参照されるファイルが存在することを確認したり、この--copy-linksオプションを使用しないでください。

個人的に--archive使用する場合は、ファイル階層またはファイルをできるだけ現実的に複製しようとします。この場合、--copy-linksシンボリックリンクを保存するためにそうしないでください。

おすすめ記事