rsync 失败:权限被拒绝(13)

rsync 失败:权限被拒绝(13)

我正在尝试使用“rsync”将文件复制到另一台机器。这是我正在尝试的命令:

sudo rsync -avztP --delete --recursive --inplace /folder1/folder2/folder3/myfile [email protected]:/backup/files -e "ssh -o StrictHostKeyChecking=no"

我收到此错误:

sending incremental file list
file1
    25728640 100%    15.38MB/s    0:00:02 (total: 100%) (xfer#1, to-check=0/1)
rsync: open "/folder1/folder2/folder3/myfile" failed: Permission denied (13)
sent 25736406 bytes  received 31 bytes  2258914.96 bytes/sec
total size is 25728640  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1355) [sender=3.0.9]

以下是本地机器的权限:

ls -ld / /folder1 /folder1/folder2/ /folder1/folder2/folder3/ /folder1/folder2/folder3/myfile

drwxr-xr-x  26 root  root      4096 Jul 25 23:00 /
drwxr-xr-x  25 root  root      4096 Sep 16 23:37 /folder1
drwxrwxrwx+ 12 root  root      4096 Feb 29  2020 /folder1/folder2/
drwxrwxrwx+  2 admin users     4096 May  4  2019 /folder1/folder2/folder3/
-rwxr-xr-x   1 admin users 25728640 May  4  2019 /folder1/folder2/folder3/myfile

以及远程机器上的权限:

ls -ld / /backup /backup/files/

drwxr-xr-x 20 root root  26 Sep  5 21:25 /
drwxr-xr-x  3 root users  3 Sep 13 02:07 /backup
drwxrwsr-x  2 root root   2 Sep 13 02:07 /backup/files/

本地计算机上的 Linux:Linux DiskStation 3.10.105

远程机器上的 Linux:Ubuntu 20.04.1 LTS、Linux 5.4.0-47-generic x86_64。

我是否遗漏了什么?

答案1

我知道这个话题已经很老了,但几天前我遇到了同样的问题,我通过删除“--inplace”选项解决了它。

相关内容