我想将Server1和Server2的日志同步到LogServer.
对于Server1:
rsync -avz -e 'ssh -p 2188' user@server1:/usr/local/servers/logs/* /usr/local/logs/
这个适用,但对于Server2:
rsync -avz -e 'ssh -p 2188' user@server2:/usr/local/servers/logs/* /usr/local/logs/
它失败:
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]
Server1和Server2都在Amazon上托管,具有相同版本的rsync.
我很确定命令中的每个目录都存在.我怎么解决这个问题?
更新:我已经尝试过ssh -p 2188 user @ server2 pwd,它不起作用:
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
截图