New modes: mirror and backup, while maintaining the bsync snaphots#48
Open
xarx00 wants to merge 9 commits intodooblem:masterfrom
Open
New modes: mirror and backup, while maintaining the bsync snaphots#48xarx00 wants to merge 9 commits intodooblem:masterfrom
xarx00 wants to merge 9 commits intodooblem:masterfrom
Conversation
Owner
|
Thanks ! let me a few days to review that. |
eliramk
reviewed
Jun 13, 2020
| cmd+= ["&&", "rm", "-f", dirname+oldsnapname] | ||
| # remove inconsistent newsnap if error in find | ||
| cmd+= " || ( rm -f "+quote(dirname+"/"+newsnapname)+" && false )" | ||
| cmd+= ["||", "(", "rm", "-f", dirname+newsnapname, "&&", "false", ")"] |
There was a problem hiding this comment.
Consider using os.path.join(dirname, newsnapname)
Author
There was a problem hiding this comment.
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.
Author
Hi, any progress? |
Updated usage in README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I made three commits:
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.
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.
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.