Tôi muốn đồng bộ hóa Server1và Server2nhật ký của LogServer.
Dành cho Server1:
rsync -avz -e 'ssh -p 2188' user@server1:/usr/local/servers/logs/* /usr/local/logs/
Cái này hoạt động, nhưng cho Server2:
rsync -avz -e 'ssh -p 2188' user@server2:/usr/local/servers/logs/* /usr/local/logs/
Nó thất bại:
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]
Cả hai Server1và Server2được lưu trữ trên Amazon với cùng một phiên bản rsync.
Tôi khá chắc chắn rằng mọi thư mục trong lệnh đều tồn tại. Làm thế nào tôi có thể giải quyết vấn đề này?
CẬP NHẬT: Tôi đã thử ssh -p 2188 user@server2 pwd, và nó không hoạt động:
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
Ảnh chụp màn hình

ls -R /usr/local/serversviệc mà không có bất kỳ lỗi?