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

Add support for REMOTE_BACKUPS #64

Closed
wants to merge 6 commits into from

Conversation

greezybacon
Copy link
Collaborator

@greezybacon greezybacon commented Aug 24, 2017

This allows the remote host to cooperate with the PUSH process and create backups on the remote host itself, for files which will be overwritten by the PUSH. Backups are already created in the pull process. This adds the same feature on the remote server.

It works by copying bitpocket to the remote server and running it. Then it sends the file names it wants to push to the bitpocket process on the remote server. Then the remote server uses the backup_inline function to handle creating backups exactly the same as what happens in the pull process.

Addreses #53

Outstanding

  • Support for sending BACKUP_EXCLUDE settings to the remote host (if the feature/backup-exclude is merged)
  • Pass all the rake tests with REMOTE_BACKUPS=true
  • Find the lurking rmdir error when cleaning the (non-)empty backup folder

@greezybacon greezybacon force-pushed the feature/remote-backups branch 2 times, most recently from fd99bab to ec2ff68 Compare August 30, 2017 00:57
Jared Hancock and others added 2 commits August 30, 2017 19:23
Use `rsync` to do the backing up

rsync has a --backup option which will accomplish what the backup_inline
function is accomplishing. However, it will add the ability to do remote
backups without doing remote shell magic.

Coincidently, this removes the parallel rsync used to do the pull(), which
may reduce the CPU and disk overhead slightly.

This allows the remote host to cooperate with the PUSH process and create
backups on the remote host itself, for files which will be overwritten by the
PUSH.

Remote backups is an optional feature, disabled by default, and can be
enabled with the REMOTE_BACKUPS option in the configuration file.
This re-introduces the behavior from ac0622c which in the backup_inline
function would detect if files were removed remotely before deleting locally.
This is necessary for long-running syncs to behave properly as files created
locally after the sync was started should be protected from removal.

It is implemented here using rsync filter rules rather than the grep expression
as before.
Jared Hancock and others added 3 commits August 31, 2017 10:03
This is similar to the code to protect locally-created files in parallel
with a long-running sync. Since files which show up after the sync takes a
directory snapshot are not protected, they could be deleted. This protects
all the remote files except for the locally-deleted files. So, the only
files removed in the push are the ones which were removed locally since the
previous sync.
Filter rules with [ * ? characters in them are considered patterns or
wildcards. However, the interpretation of bitpocket is that they should be
considered exact file names. This patch properly escapes the characters in
the file names in the analysis phase.
Also be more consistent. Use the exact same expressions and replacements in all
places where it used.
@greezybacon
Copy link
Collaborator Author

This has been merged into the master branch and released in https://github.com/sickill/bitpocket/releases/tag/v0.2

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.

None yet

1 participant