I have the following setup to periodically rsync files from server A to server B. Server B has the rsync daemon running with the following configuration:
read only = false
use chroot = false
max connections = 4
syslog facility = local5
log file = /var/adm/rsyncd.log
munge symlinks = false
secrets file = /etc/rsyncd.secrets
numeric ids = false
transfer logging = true
log format = %h %o %f %l %b
[BACKUP]
path = /path/to/archive
auth users = someuser
From server A I am issuing the following command:
rsync -adzPvO --delete --password-file=/path/to/pwd/file/pwd.dat /dir/to/be/backedup/ someuser@192.168.100.100::BACKUP
BACKUP directory is fully read/write/execute to everyone. When I run the rsync command from server A, I see:
afile.txt
989 100% 2.60kB/s 0:00:00 (xfer#78, to-check=0/79)
for each and everyfile in the directory I wish to backup. It fails when I get to writing tmp files:
rsync: mkstemp "/.afile.txt.PZQvTe" (in BACKUP) failed: Permission denied (13)
Hours of googling later and I still can't resolve what seems to be a very simple permission issue. Advice? Thanks in advance.
Additional Information
I just noticed the following occurs at the beginning of the process:
rsync: failed to set permissions on "/." (in BACKUP): Permission denied (13)
Is it trying to set permission on "/"?
Edit
I am logged in as the user - someuser. My destination directory has full read/write/execute permission for everyone, including it's contents. In addition, the destination directory is owned by someuser and in someuser's group.
Follow up
I've found using SSH solves this
I encountered the same problem and solved it by
chown
the user of the destination folder. The current user does not have the permission to read, write and execute the destination folder files. Try adding the permission bychmod a+rwx <folder/file name>
.I had the same error while syncing files inside of a Docker container and the destination was a mounted volume (Docker for mac), I run
rsync
viasu-exec <user>
. I was able to resolve it by runningrsync
asroot
with-og
flags (keep owner and group for destination files).I'm still not sure what caused that issue, the destination permissions were OK (I run
chown -R <user>
for destination dir beforersync
), perhaps somehow related to Docker for Mac slow filesystem.This might not suit everyone since it does not preserve the original file permissions but in my case it was not important and it solved the problem for me. rsync has an option
--chmod
:This forces the permissions to be what you want on all files/directories. For example:
would add Read, Write and Execute for the user to all transferred directories.
Windows: Check permissions of destination folders. Take ownership if you must to give rights to the account running the rsync service.