I want to sync Server1
and Server2
's logs to LogServer
.
For Server1
:
rsync -avz -e 'ssh -p 2188' user@server1:/usr/local/servers/logs/* /usr/local/logs/
This one works, but for Server2
:
rsync -avz -e 'ssh -p 2188' user@server2:/usr/local/servers/logs/* /usr/local/logs/
It fails:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory
rsync: getcwd(): No such file or directory (2)
rsync error: errors selecting input/output files, dirs (code 3) at util.c(992) [sender=3.0.6]
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [receiver=3.0.6]
Both Server1
and Server2
is hosted on Amazon with the same version of rsync
.
I am quite sure that every directory in the command is exists. How can I solve this problem?
UPDATE: I have tried ssh -p 2188 user@server2 pwd
, and it doesn't work:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: no such file or directory