I'm using rsync between two servers to transfer files.

The problem is some files are not transferred. I get this error : rsync: readlink "/var/www/index.html" failed: Permission denied (13)

So I check permissions on the server and after make tests, I notice a file is transferred only if it has these permissions : R-W ! If the file have these permissions : R--, Rsync can't download it !?


/usr/bin/rsync -avzr -e "/usr/bin/ssh -i /home/replication/thishost-rsync-key" replication@ ./

Is it a bug with Rsync ? I find any information about this problem.

Thanks for your help

Debian Etch 2.6.30 Rsync 2.6.9 protocol version 29

  • whats the output of ls -al /var/www/index.html
    – pablo
    Mar 9 '11 at 13:38

rsync needs to be able to read the files you are trying to copy, so my guess is that the user running rsync does not have read permission on the file in question.

If that's the case, you can either grant read access on the file to that user, or use a different account that already has read access on all the files you are trying to copy.

If that's not the problem, please post the output of ls -l /var/www/index.html


To verify it's a permission thing as rsync tells, try:

ssh replication@ "ls -al /var/www/index.html"
ssh replication@ "ls -al /var/www/"

Take a look if some files that do not get transferred are symlinks that point outside the tree; if so, take a look at the --safe-links or --copy-links arguments.

Either change the permissions or change the user.

You could give more "verbosity" to rsync like with rsync -avvv [...] to see even more error messages.

The "r" parameter is not needed as "a" defaults to "-rlptgoD". And as you copy recursively, leave out the "index.html", just write "/var/www/" with the trailing slash.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy