rsync chokes on read-only files

3

1

I'm using rsync on Mac to back up to a USB drive or a network image (also HFS+ formatted). I'm having trouble with files from .svn subdirectories, such as 'all-wcprops' or 'entries' -- when checking out or updating, Subversion marks them as read-only (permissions bits are 444).

My rsync command chokes on that; they are backed up correctly during the first run, but any changes cause "permission denied" errors on target (backup volumes).

Maybe it's an artefact of Tortoise SVN - I'm actually using it from an XP virtual machine to do svn operations. But not using Tortoise is not an option.

How can I fix it? I spent some time trawling through rsync manuals and all the proper flags seem to be set. Can't find anything in Tortoise prefs either to allow me to tell it not to mark these files read only.

Here is my rsync command:

rsync -aNHAX --inplace --verbose --delete --delete-excluded --fileflags --force-change --exclude-from=.rsync/exclude-list ~ $backup_dir

ttarchala

Posted 2009-10-28T11:24:49.603

Reputation: 771

Answers

4

I think you could either not use "--inplace" or synchronize in two steps.
This enhancement of rsync could also help you.

weismat

Posted 2009-10-28T11:24:49.603

Reputation: 335

Thanks, without --inplace it actually works. Actually now I can see it in the rsync manual - "Also note that rsync will be unable to update a file in-place that is not writable by the receiving user". – ttarchala – 2009-10-28T12:03:20.353

0

I think the problem might be that the external drive or network image might have a space in the volume path and rsync isn't escaping the space.

That is if your volume is named "Big Honking USB" the path is probably something like

/Volumes/Big Honking USB

and rsync isn't smart enough to realize it and escape the spaces. Try rsyncing to somewhere like /home/username/Downloads and seeing if that works.

Aphoid

Posted 2009-10-28T11:24:49.603

Reputation: 41

Thank you for the interesting idea. But after nearly 8 years since asking the original question, I have moved away from rsync as the backup mechanism and I no longer have a way to test if your answer is good :-) – ttarchala – 2017-05-23T21:37:45.337

I ran into this problem just yesterday, so it seems to still exist. ;) – Aphoid – 2017-05-24T14:26:57.747