1

I am trying to use "rsync" to copy file to another machine. This is the command I am trying:

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

I am getting this error:

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]

Here are the permissions of the local machine:

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

And the permissions on the remote machine:

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 on local machine: Linux DiskStation 3.10.105

Linux on remote machine: Ubuntu 20.04.1 LTS, Linux 5.4.0-47-generic x86_64.

Am I missing anything?

13
  • What linux version? Check SELinux on target machine.
    – tater
    Sep 17, 2020 at 1:42
  • The error is about not being able to open the file on the source machine. Are you sure I should check the target machine?
    – bashan
    Sep 18, 2020 at 13:53
  • The target machine linux is: Ubuntu 20.04.1 LTS, Linux 5.4.0-47-generic x86_64. The source machine is: Linux DiskStation 3.10.105
    – bashan
    Sep 18, 2020 at 13:55
  • This is "ls -ld /backup/files/" on the remote target. Please note it doesn't have "file1" yet, since it was never rsynced: drwxrwsr-x 2 root root 2 Sep 13 02:07 /backup/files/
    – bashan
    Sep 22, 2020 at 18:35
  • This is the "ls" on the source: drwxr-xr-x 26 root root 4096 Jul 25 23:00 / drwxr-xr-x 25 root root 4096 Sep 16 23:37 /some drwxrwxrwx+ 12 root root 4096 Feb 29 2020 /some/folder/ drwxrwxrwx+ 2 admin users 4096 May 4 2019 /some/folder/folder2/ -rwxr-xr-x 1 admin users 15728640 May 4 2019 /some/folder/folder2/file
    – bashan
    Sep 22, 2020 at 18:39

1 Answer 1

3

I know this topic is quite old but I had the same problem a few days before and I fixed it by removing the "--inplace" option.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .