dooblem/bsync

ACL and batch mode: improvement proposal

Opened this issue · 3 comments

bsync.txt

Hi

I propose following changes, and attach a diff file bsync.txt with a suggested implementation:

  1. -b (batch mode) should in my opinion skip the "Apply actions" prompt (or alternatively would be better provide a silent option)
  2. I added --acls, --xattrs and --compress to rsync arguments, just because I needed them: would be nice to add them by default or allow them optionally
  3. in conflict prompt I added option "r" and "ra" to allow automatic resolution of conflicts based on following rules:
  • in case of deletion on one side, and update on another side, choose sync of updated file instead of deletion of removed file
  • in case of updated file in both sides, privilege the most recent file
  • in other cases, give precedence to left side
  1. I added a -a (autoanswer) option, with which is possible to decide the answer to all conflicts prompts (1, 2 or r)

I know, it can be very dangerous to allow automatic resolution of conflicts, but that's what I need and I think is very helpful to give possibility to a completely background run.

A feature to backup conflicted files and directory would be wonderful. In rsync there is --backup option, but I think is not useful in the cases when rsync is called inside bsync.

I never coded in python, so be indulgent with provided code.

PS
bsync is one of few programs I could find that allow remote and bidirectional synchronization based on rsync with move and rename detection of files and directory.

Thank you for sharing it

Hello Stefano,

Thanks for using bsync.

My comments
Point 1: right, you found a bug.

Point 2 : Good idea, but I would suggest adding a single option to add any rsync argument (a bit like -o option for ssh). However, for acl and xattrs, pay attention that bsync will not detect changes in acls or xattr (due bsync snapshot file format).

Point 3: I'm not absolutely sure of what is the best algorithm for automatic resolution. But anyway I think there is no perfect solution for that. Sounds good.

Point 4: A -a option will be weird with -b option (and -a is to close to rsync famous option). I would suggest modifying the -b option to accept an argument : with "-b" or "-b e" we get the actual behaviour : exit on conflict.

If you have time, feel free to modify/code. I do not have plenty of time for bsync those days.

Anyway, thanks for your contribution.

Marc

Hello Marc

If you have time, feel free to modify/code

I never used github to code, I don't know what you mean about it. Can I
modify the main branch or you suggest me to fork?

2016-02-18 21:44 GMT+01:00 Marc MAURICE notifications@github.com:

Hello Stefano,

Thanks for using bsync.

My comments
Point 1: right, you found a bug.

Point 2 : Good idea, but I would suggest adding a single option to add any
rsync argument (a bit like -o option for ssh). However, for acl and xattrs,
pay attention that bsync will not detect changes in acls or xattr (due
bsync snapshot file format).

Point 3: I'm not absolutely sure of what is the best algorithm for
automatic resolution. But anyway I think there is no perfect solution for
that. Sounds good.

Point 4: A -a option will be weird with -b option (and -a is to close to
rsync famous option). I would suggest modifying the -b option to accept an
argument : with "-b" or "-b e" we get the actual behaviour : exit on
conflict.

If you have time, feel free to modify/code. I do not have plenty of time
for bsync those days.

Anyway, thanks for your contribution.

Marc


Reply to this email directly or view it on GitHub
#23 (comment).