rdiff-backup [Errno 13] Permission denied

Submitted by Nikolaus Polak on Thu, 05/29/2014 - 09:23
Kategorie

Running a rdiff-backup, which somebody else configured, throw after the first run always one of these two errors:

# rdiff-backup /var/YYY/ [email protected]::/home/user/YYY
Exception '[Errno 13] Permission denied: '/home/user/YYY/rdiff-backup-data'' raised of class  '<type 'exceptions.OSError'>':
...
## or:
Previous backup seems to have failed, regressing destination now.
Exception '[Errno 13] Permission denied: '/home/user/YYY/rdiff-backup-data/current_mirror.2014-05-22T17:43:58+02:00.data'' raised of class '<type 'exceptions.OSError'>':
...

First I asked the big search machine but couldn't find the right solution for this problem - the error didn't dissapear, and there was only the first backup stored on the target server. So I checked the permissions on the source server, even if this backup runs as user "root":

/var# ls -l
insgesamt 52
drw-------  2 root  root   4096 Mai 22 17:43 YYY

Now the problem was clear to me - the source directory was missing the execute permission to change into the directory. As root on the source server this is no problem, but as rdiff-backup transfers the permission to the target server and there is only a normal user used the first transferred backup can't be read, changed or overwritten.

Solving the problem: Add the needed/missing permissions to the source directory

/var# chmod u+x YYY

On the target server you've to fix either also all permissions, or remove the whole backupdir.