我想将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

截图

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐