Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New modes: mirror and backup, while maintaining the bsync snaphots #48

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

xarx00
Copy link

@xarx00 xarx00 commented May 28, 2020

I made three commits:

  1. bsync didn't work in Windows with the only rsync I've found (cwRsync). cwRsync doesn't recognise disk-letter colons, Bsync had similar problems with Windows. First commit fixes this.

  2. bsync required that all conflicts were resolved immediately. In batch mode, bsync stopped on the first conflict. The second commit allows correct handling of unresolved conflicts - they are left for later bsync runs. This is also required for the third commit.

  3. Third commit implements new uni-directional synchronization modes: backup and mirror (backup doesn't synchronize deletes). These modes correctly update bsync snaphots. Execution of bi-directional sync and uni-directional mirror and backup can be mixed without breaking the snapshots. Second commit is required.

I also added python unit tests of bsync of all tree modes.

Note: I tested that only locally in Windows, though I tried to keep it working in posix/ssh.

@dooblem
Copy link
Owner

dooblem commented May 29, 2020

Thanks ! let me a few days to review that.

# remove inconsistent newsnap if error in find
cmd+= " || ( rm -f "+quote(dirname+"/"+newsnapname)+" && false )"
cmd+= ["||", "(", "rm", "-f", dirname+newsnapname, "&&", "false", ")"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using os.path.join(dirname, newsnapname)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to change that to path.join. Internally, even on Windows, bsync uses slashes everywhere - because it uses posix tools and because all snapshots contain slashes only. So using path.join at this place would be singular.
However, your remark suggests me that path.join should be removed on the remaining three places too, though it probably doesn't break anything, not even on Windows. I haven't tested bsync on Windows in ssh mode, so I cannot tell.

@xarx00
Copy link
Author

xarx00 commented Jul 31, 2020

Thanks ! let me a few days to review that.

Hi, any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants