Open ceremcem opened 10 years ago
At first I thought it was the correct behaviour, and I coded it this way : you expect bsync to make both directories exactly identical, so if any read error occur it should fail.
But I'm thinking it again, and it will probably be ok if bsync just ignores unreadable files/dirs.
I'll take a look at that.
For now, as a workaround you can add a .bsync-ignore file at the root of your directory (see in the README).
I'm deleting the file (in most cases if I can not solve the issue via setting appropriate permissions, that is because it's a special file) or setting appropriate permissions/ownership as a workaround. I think bsync should write down original permissions to an "after sync jobs" file, change the permissions, complete sync, change permissions to the original state.
You mean being able to sync directories if the user removed himself the permissions? Hum.. this would be a complicated task. Even rsync is not syncing this way.
I made a patch in a new branch. You can try it here: https://raw.githubusercontent.com/dooblem/bsync/nostrict/bsync
The run will continue even if there is find errors to get file lists, or to make the snapshots, or if there are rsync errors.
I may add it as an option later.
Note that this will work and ignore new files/dirs added if they do not have the correct permissions. However, in existing synced directories, if you remove permission on a directory, all files bellow that dir will be considered as deleted. You'll have to check carefully before accepting the sync.
Working around this is hard because bsync would have to parse the stderr of gnu find. For now I see no clean and easy way to do that.
Let me know if you test my branch...
I'll dig when I have time:
Permission may be denied, but sync must keep going on as much as possible.