私の問題は、私が解決したいより大きな問題のほんの一部です。
問題は、rsync
ansibleで構築された非常に複雑なコマンドで始まり、機能しません。ここに報告されています。
リモートホストからローカルにフォルダをコピーする簡単なrsyncコマンドで始めたいです。
リモートがファイルの場合はコピーしますが、リモートがディレクトリの場合はコピーは失敗します。
$ /bin/rsync --version
rsync version 3.1.2 protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, symtimes, prealloc
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
[mylocaluser@mylocalhost myremotehost]$ uname -a
Linux mylocalhost 3.10.0-1160.76.1.el7.x86_64 #1 SMP Tue Jul 26 14:15:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Rsyncはファイルで動作します。
$ /bin/rsync -v myremoteuser@myremotehost:/tmp/Deployments/pay.war /web/playbooks/automation/getfiles/tmpfiles/4/E5EA787E/myremotehost/
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 *** #
##################################################################
pay.war
sent 43 bytes received 83 bytes 252.00 bytes/sec
total size is 0 speedup is 0.00
ところで、ファイルの代わりにディレクトリを提供しても機能しません。
$ /bin/rsync -v myremoteuser@myremotehost:/tmp/Deployments/ /web/playbooks/automation/getfiles/tmpfiles/4/E5EA787E/myremotehost/
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 *** #
##################################################################
skipping directory .
sent 8 bytes received 30 bytes 25.33 bytes/sec
total size is 0 speedup is 0.00
提案してください。
ベストアンサー1
によるとrsync --help
:
--recursive、-rディレクトリに再帰
したがって、ディレクトリをコピーするには追加するかオプションを選択する必要が-r
あります--recursive
。rysnc:
/bin/rsync -rv myremoteuser@myremotehost:/tmp/Deployments/ /web/playbooks/automation/getfiles/tmpfiles/4/E5EA787E/myremotehost/